home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / mail / sendmail / UCB / sendmail.8.6.6.patch.Z / sendmail.8.6.6.patch
Encoding:
Text File  |  1994-03-12  |  240.7 KB  |  8,983 lines

  1. *** KNOWNBUGS.OLD    Wed Jan 12 06:00:44 1994
  2. --- KNOWNBUGS    Sun Mar 13 10:10:15 1994
  3. ***************
  4. *** 1,25 ****
  5.   
  6.   
  7.            K N O W N   B U G S   I N   S E N D M A I L
  8. !                  (for 8.6.5)
  9.   
  10.   
  11.   The following are bugs or deficiencies in sendmail that I am aware of
  12.   but which have not been fixed in the current release.  You probably
  13.   want to get the most up to date version of this from FTP.CS.Berkeley.EDU
  14. ! in /ucb/sendmail/KNOWNBUGS.
  15.   
  16. ! This list is not guaranteed to be complete, especially for fixed bugs.
  17. ! Many bugs are reported and fixed without ever making it as far as this
  18. ! file.  See the file RELEASE_NOTES (in the root directory of the sendmail
  19. ! distribution) for more details.
  20.   
  21.   
  22. - +----------------------------------------------+
  23. - | THE FOLLOWING PROBLEMS ARE STILL OUTSTANDING |
  24. - +----------------------------------------------+
  25.   * Null bytes are not handled properly.
  26.   
  27.     Sendmail should handle full binary data.  As it stands, it handles
  28. --- 1,19 ----
  29.   
  30.   
  31.            K N O W N   B U G S   I N   S E N D M A I L
  32. !                  (for 8.6.6)
  33.   
  34.   
  35.   The following are bugs or deficiencies in sendmail that I am aware of
  36.   but which have not been fixed in the current release.  You probably
  37.   want to get the most up to date version of this from FTP.CS.Berkeley.EDU
  38. ! in /ucb/sendmail/KNOWNBUGS.  For descriptions of bugs that have been
  39. ! fixed, see the file RELEASE_NOTES (in the root directory of the sendmail
  40. ! distribution).
  41.   
  42. ! This list is not guaranteed to be complete.
  43.   
  44.   
  45.   * Null bytes are not handled properly.
  46.   
  47.     Sendmail should handle full binary data.  As it stands, it handles
  48. ***************
  49. *** 125,171 ****
  50.     You can eliminate this by adding commas at the end of each line
  51.     of the :include: file.
  52.   
  53.   
  54. ! +-------------------------------------------+
  55. ! | THE FOLLOWING PROBLEMS ARE FIXED IN 8.6.5 |
  56. ! +-------------------------------------------+
  57.   
  58. ! * Route-addrs missing angle brackets.
  59. !   There are cases where route-addrs do not get angle brackets around them,
  60. !   such as in the "-r" flag on mailers or in the From_ line created when
  61. !   mailing to files.
  62. ! * No "exposed users" in "nullrelay" configuration.
  63. !   The "nullrelay" configuration hides all addresses behind the mail
  64. !   hub name.  Some sites might prefer to expose some names such as
  65. !   root.  This information is always available in Received: lines.
  66. ! * owner-* alias that uses :include: broken.
  67. !   If you have aliases set up as:
  68. !     owner-listname:        :include:/some/file
  69. !   sendmail will break because it considers this a "sender address",
  70. !   which is not permitted to use the :include: syntax.  The easiest
  71. !   workaround is to change this to:
  72. !     owner-listname:        :include:/some/file,
  73. !   (note the trailing comma); a somewhat cleaner solution is to use:
  74. !     owner-listname:        listname-request
  75. !     listname-request:    :include:/some/file
  76. ! * "SYSERR: openmailer(local): fd 1 not open" message
  77. !   File descriptor 1 (standard output) should not be closed during normal
  78. !   processing.  This is checked periodically, and sometimes this condition
  79. !   is found and this message is produced.  Sendmail repairs the problem,
  80. !   and the mail is still delivered, but I still don't know why it happens.
  81. !   (There was a bug that was fixed in 8.6.beta.13 that might be related,
  82. !   but I think this bug still exists.)
  83. ! (Version 8.15, last updated 1/12/94)
  84. --- 119,131 ----
  85.     You can eliminate this by adding commas at the end of each line
  86.     of the :include: file.
  87.   
  88. + * Excessive mailing list nesting can run out of file descriptors.
  89.   
  90. !   If you have a mailing list that includes lots of other mailing
  91. !   lists, each of which has a separate owner, you can run out of
  92. !   file descriptors.  Each mailing list with a separate owner uses
  93. !   one open file descriptor (prior to 8.6.6 it was three open
  94. !   file descriptors per list).  This is particularly egregious if
  95. !   you have your connection cache set to be large.
  96.   
  97. ! (Version 8.17, last updated 3/13/94)
  98. *** Makefile.OLD    Sat Sep 25 08:37:04 1993
  99. --- Makefile    Sun Feb 27 09:01:37 1994
  100. ***************
  101. *** 1,22 ****
  102. ! #       @(#)Makefile    8.2 (Berkeley) 9/25/93
  103.   
  104.   SUBDIR= src mailstats makemap praliases
  105.   VER=    XX
  106.   
  107.   tar: Files.base Files.cf Files.misc Files.xdoc
  108.       (cd src; ${MAKE})
  109.       (cd doc; PRINTER=ps ${MAKE})
  110.       (cd cf/cf; ${MAKE})
  111. !     pax -w -x tar -L -f sendmail.${VER}.base.tar `cat Files.base`
  112.       compress sendmail.${VER}.base.tar
  113. !     pax -w -x tar -L -f sendmail.${VER}.cf.tar `cat Files.cf`
  114.       compress sendmail.${VER}.cf.tar
  115. !     pax -w -x tar -L -f sendmail.${VER}.misc.tar `cat Files.misc`
  116.       compress sendmail.${VER}.misc.tar
  117. !     pax -w -x tar -L -f sendmail.${VER}.xdoc.tar `cat Files.xdoc`
  118.       compress sendmail.${VER}.xdoc.tar
  119.   
  120.   ftp: sendmail.${VER}.base.tar.Z sendmail.${VER}.cf.tar.Z sendmail.${VER}.misc.tar.Z sendmail.${VER}.xdoc.tar.Z
  121. !     rcp sendmail.${VER}.*.tar.Z RELEASE_NOTES barad-dur:/disks/barad-dur/ftp/sendmail/.
  122.   
  123.   .include <bsd.subdir.mk>
  124. --- 1,24 ----
  125. ! #       @(#)Makefile    8.3 (Berkeley) 2/27/94
  126.   
  127.   SUBDIR= src mailstats makemap praliases
  128. + FTPDIR=    barad-dur:/disks/barad-dur/ftp/sendmail/.
  129.   VER=    XX
  130.   
  131.   tar: Files.base Files.cf Files.misc Files.xdoc
  132.       (cd src; ${MAKE})
  133.       (cd doc; PRINTER=ps ${MAKE})
  134. +     (cd doc; chmod 444 op/op.ps intro/intro.ps usenix/usenix.ps)
  135.       (cd cf/cf; ${MAKE})
  136. !     pax -w -x tar -L -f sendmail.${VER}.base.tar `grep -v ^# Files.base`
  137.       compress sendmail.${VER}.base.tar
  138. !     pax -w -x tar -L -f sendmail.${VER}.cf.tar `grep -v ^# Files.cf`
  139.       compress sendmail.${VER}.cf.tar
  140. !     pax -w -x tar -L -f sendmail.${VER}.misc.tar `grep -v ^# Files.misc`
  141.       compress sendmail.${VER}.misc.tar
  142. !     pax -w -x tar -L -f sendmail.${VER}.xdoc.tar `grep -v ^# Files.xdoc`
  143.       compress sendmail.${VER}.xdoc.tar
  144.   
  145.   ftp: sendmail.${VER}.base.tar.Z sendmail.${VER}.cf.tar.Z sendmail.${VER}.misc.tar.Z sendmail.${VER}.xdoc.tar.Z
  146. !     rcp sendmail.${VER}.*.tar.Z RELEASE_NOTES FAQ KNOWNBUGS ${FTPDIR}
  147.   
  148.   .include <bsd.subdir.mk>
  149. *** READ_ME.OLD    Tue Jan  4 07:52:09 1994
  150. --- READ_ME    Wed Jan 26 17:39:28 1994
  151. ***************
  152. *** 1,5 ****
  153.   /*-
  154. !  *    @(#)READ_ME    8.8 (Berkeley) 1/4/94
  155.    */
  156.   
  157.               SENDMAIL RELEASE 8
  158. --- 1,5 ----
  159.   /*-
  160. !  *    @(#)READ_ME    8.9 (Berkeley) 1/26/94
  161.    */
  162.   
  163.               SENDMAIL RELEASE 8
  164. ***************
  165. *** 113,123 ****
  166.       RFC987    Mapping between RFC822 and X.400
  167.       RFC1049    Content-Type header field (extension to RFC822)
  168.   
  169. ! Unfortunately, for a variety of reasons the Makefiles are for the new
  170. ! Berkeley "make" and will not work on the old, traditional make.  I urge
  171. ! you to get this make from Net2 (available on many public FTP archives).
  172. ! Failing that, some directories have a "Makefile.dist" that will work on
  173. ! older versions of make (but don't have the niceties included).
  174.   
  175.   
  176.   +-------------------+
  177. --- 113,121 ----
  178.       RFC987    Mapping between RFC822 and X.400
  179.       RFC1049    Content-Type header field (extension to RFC822)
  180.   
  181. ! Warning to AIX users: this version of sendmail does not implement
  182. ! MB, MR, or MG DNS resource records, as defined as experiments in
  183. ! RFC883.
  184.   
  185.   
  186.   +-------------------+
  187. ***************
  188. *** 134,140 ****
  189. --- 132,142 ----
  190.   also probably find that you have to add -I/where/you/put/db/include
  191.   to the sendmail makefile to get db.h to work properly.
  192.   
  193. + Be sure you remove ndbm.h and ndbm.o from the db distribution.  These
  194. + will cause problems with sendmail because sendmail already understands
  195. + about NEWDB and NDBM coexisting.
  196.   
  197.   +-------------+
  198.   | USE WITH MH |
  199.   +-------------+
  200. ***************
  201. *** 163,169 ****
  202.       BINDIR?=    /usr/sbin
  203.   
  204.   The other directories should all have Makefile.dist files that work
  205. ! on the old make.  For more details, see src/READ_ME.
  206.   
  207.   
  208.   +---------------------+
  209. --- 165,177 ----
  210.       BINDIR?=    /usr/sbin
  211.   
  212.   The other directories should all have Makefile.dist files that work
  213. ! on the old make, albeit without all the niceties included.
  214. ! You can also get a new Berkeley make from the Net2 release (available
  215. ! on many public FTP archives).  This version should also interpret old
  216. ! Makefiles, so you could drop it in as your default make.
  217. ! For more details, see src/READ_ME.
  218.   
  219.   
  220.   +---------------------+
  221. *** RELEASE_NOTES.OLD    Fri Jan 14 07:13:10 1994
  222. --- RELEASE_NOTES    Sun Mar 13 09:42:08 1994
  223. ***************
  224. *** 1,3 ****
  225. --- 1,242 ----
  226. +             SENDMAIL RELEASE NOTES
  227. +          @(#)RELEASE_NOTES    8.6.6.1 (Berkeley) 3/13/94
  228. + This listing shows the version of the sendmail binary, the version
  229. + of the sendmail configuration files, the date of release, and a
  230. + summary of the changes in that release.
  231. + 8.6.6/8.6.6    94/03/13
  232. +     SECURITY: the ability to give files away on System V-based
  233. +         systems proved dangerous -- don't run as the owner
  234. +         of a :include: file on a system that allows giveaways.
  235. +         Unfortunately, this also applies to determining a
  236. +         valid shell.
  237. +     IMPORTANT: Previous versions weren't expiring old connections
  238. +         in the connection cache for a long time under some
  239. +         circumstances.  This could result in resource exhaustion,
  240. +         both at your end and at the other end.  This checks the
  241. +         connections for timeouts much more frequently.  From
  242. +         Doug Anderson of NCSC.
  243. +     Fix a glitch that snuck in that caused programs to be run as
  244. +         the sender instead of the recipient if the mail was
  245. +         from a local user to another local user.  From
  246. +         Motonori Nakamura of Kyoto University.
  247. +     Fix "wildcard" on /etc/shell matching -- instead of looking
  248. +         for "*", look for "/SENDMAIL/ANY/SHELL/".  From
  249. +         Bryan Costales of ICSI.
  250. +     Change the method used to declare the "statfs" availability;
  251. +         instead of HASSTATFS and/or HASUSTAT with a ton of
  252. +         tweaking in conf.c, there is a single #define called
  253. +         SFS_TYPE which takes on one of six values (SFS_NONE
  254. +         for no statfs availability, SFS_USTAT for the ustat(2)
  255. +         syscall, SFS_4ARGS for a four argument statfs(2) call,
  256. +         and SFS_VFS, SFS_MOUNT, or SFS_STATFS for a two argument
  257. +         statfs(2) call with the declarations in <sys/vfs.h>,
  258. +         <sys/mount.h>, or <sys/statfs.h> respectively).
  259. +     Fix glitch in NetInfo support that could return garbage if
  260. +         there was no "/locations/sendmail" property.  From
  261. +         David Meyer of the University of Virginia.
  262. +     Change HASFLOCK from defined/not-defined to a 0/1 definition
  263. +         to allow Linux to turn it off even though it is a
  264. +         BSD-like system.
  265. +     Allow setting of "ident" timeout to zero to turn off the ident
  266. +         protocol entirely.
  267. +     Make 7-bit stripping local to a connection (instead of to a
  268. +         mailer); this allows you to specify that SMTP is a
  269. +         7-bit channel, but revert to 8-bit should it advertise
  270. +         that it supports 8BITMIME.  You still have to specify
  271. +         mailer flag 7 to get this stripping at all.
  272. +     Improve makesendmail script so it handles more cases automatically.
  273. +     Tighten up restrictions on taking ownership of :include: files
  274. +         to avoid problems on systems that allow you to give away
  275. +         files.
  276. +     Fix a problem that made it impossible to rebuild the alias
  277. +         file if it was on a read-only file system.  From
  278. +         Harry Edmon of the University of Washington.
  279. +     Improve MX randomization function.  From John Gardiner Myers
  280. +         of CMU.
  281. +     Fix a minor glitch causing a bogus message to be printed (used
  282. +         %s instead of %d in a printf string for the line number)
  283. +         when a bad queue file was read.  From Harry Edmon.
  284. +     Allow $s to remain NULL on locally generated mail.  I'm not
  285. +         sure this is necessary, but a lot of people have complained
  286. +         about it, and there is a legitimate question as to whether
  287. +         "localhost" is legal as an 822-style domain.
  288. +     Fix a problem with very short line lengths (mailer L= flag) in
  289. +         headers.  This causes a leading space to be added onto
  290. +         continuation lines (including in the body!), and also
  291. +         tries to wrap headers containing addresses (From:, To:,
  292. +         etc) intelligently at the shorter line lengths.  Problem
  293. +         Reported by Lars-Johan Liman of SUNET Operations Center.
  294. +     Log the real user name when logging syserrs, since these can have
  295. +         security implications.  Suggested by several people.
  296. +     Fix address logging of cached connections -- it used to always
  297. +         log the numeric address as zero.  This is a somewhat
  298. +         bogus implementation in that it does an extra system
  299. +         call, but it should be an inexpensive one.  Fix from
  300. +         Motonori Nakamura.
  301. +     Tighten up handling of short syslog buffers even more -- there
  302. +         were cases where the outgoing relay= name was too long
  303. +         to share a line with delay= and mailer= logging.
  304. +     Limit the overhead on split envelopes to one open file descriptor
  305. +         per envelope -- previously the overhead was three
  306. +         descriptors.  This was in response to a problem reported
  307. +         by P{r (Pell) Emanuelsson.
  308. +     Fixes to better handle the case of unexpected connection closes;
  309. +         this redirects the output to the transcript so the info
  310. +         is not lost.  From Eric Wassenaar.
  311. +     Fix potential string overrun if you macro evaluate a string that
  312. +         has a naked $ at the end.  Problem noted by James Matheson
  313. +         <jmrm@eng.cam.ac.uk>.
  314. +     Make default error number on $#error messages 553 (``Requested
  315. +         action not taken: mailbox name not allowed'') instead of
  316. +         501 (``Syntax error in parameters or arguments'') to
  317. +         avoid bogus "protocol error" messages.
  318. +     Strip off any existing trailing dot on names during $[ ... $]
  319. +         lookup.  This prevents it from ending up with two dots
  320. +         on the end of dot terminated names.  From Wesley Craig
  321. +         of the University of Michigan and Bryan Costales of ICSI.
  322. +     Clean up file class reading so that the debugging information is
  323. +         more informative.  It hadn't been using setclass, so you
  324. +         didn't see the class items being added.
  325. +     Avoid core dump if you are running a version of sendmail where
  326. +         NIS is compiled in, and you specify an NIS map, but
  327. +         NIS is not running.  Fix from John Oleynick of
  328. +         Rutgers.
  329. +     Diagnose bizarre case where res_search returns a failure value,
  330. +         but sets h_errno to a success value.
  331. +     Make sure that "too many hops" messages are considered important
  332. +         enough to send an error to the Postmaster (that is, the
  333. +         address specified in the P option).  This fix should
  334. +         help problems that cause the df file to be left around
  335. +         sometimes -- unfortunately, I can't seem to reproduce
  336. +         the problem myself.
  337. +     Avoid core dump (null pointer reference) on EXPN command; this
  338. +         only occurred if your log level was set to 10 or higher
  339. +         and the target account was an alias or had a .forward file.
  340. +         Problem noted by Janne Himanka.
  341. +     Avoid "denial of service" attacks by someone who is flooding your
  342. +         SMTP port with bad commands by shutting the connection
  343. +         after 25 bad commands are issued.  From Kyle Jones of
  344. +         UUNET.
  345. +     Fix core dump on error messages with very long "to" buffers;
  346. +         fmtmsg overflows the message buffer.  Fixed by trimming
  347. +         the to address to 203 characters.  Problem reported by
  348. +         John Oleynick.
  349. +     Fix configuration for HASFLOCK -- there were some spots where
  350. +         a #ifndef was incorrectly #ifdef.  Pointed out by
  351. +         George Baltz of the University of Maryland.
  352. +     Fix a typo in savemail() that could cause the error message To:
  353. +         lists to be incorrect in some places.  From Motonori
  354. +         Nakamura.
  355. +     Fix a glitch that can cause duplicate error messages on split
  356. +         envelopes where an address on one of the lists has a
  357. +         name server failure.  Fix from Voradesh Yenbut of the
  358. +         University of Washington.
  359. +     Fix possible bogus pointer reference on ESMTP parameters that
  360. +         don't have an ``=value'' part.
  361. +     CNAME loops caused an error message to be generated, but also
  362. +         re-queued the message.  Changed to just re-queue the
  363. +         message (it's really hard to just bounce it because
  364. +         of the wierd way the name server works in the presence
  365. +         of CNAME loops).  Problem noted by James M.R.Matheson
  366. +         of Cambridge University.
  367. +     Avoid giving ``warning: foo owned process doing -bs'' messages
  368. +         if they use ``MAIL FROM:<foo>'' where foo is their true
  369. +         user name.  Suggested by Andreas Stolcke of ICSI.
  370. +     Change the NAMED_BIND compile flag to be a 0/1 flag so you can
  371. +         override it easily in the Makefile -- that is, you can
  372. +         turn it off using -DNAMED_BIND=0.
  373. +     If a gethostbyname(...) of an address with a trailing dot fails,
  374. +         try it without the trailing dot.  This is because if
  375. +         you have a version of gethostbyname() that falls back
  376. +         to NIS or the /etc/hosts file it will fail to find
  377. +         perfectly reasonable names that just don't happen to
  378. +         be dot terminated in the hosts file.  You don't want to
  379. +         strip the dot first though because we're trying to ensure
  380. +         that country names that match one of your subdomains get
  381. +         a chance.
  382. +     PRALIASES: fix bogus output on non-null-terminated strings.
  383. +         From Bill Gianopoulos of Raytheon.
  384. +     CONFIG: Avoid rewriting anything that matches $w to be $j.
  385. +         This was in code intended to only catch the self-literal
  386. +         address (that is, [1.2.3.4], where 1.2.3.4 is your
  387. +         IP address), but the code was broken.  However, it will
  388. +         still do this if $M is defined; this is necessary to
  389. +         get client configurations to work (sigh).  Note that this
  390. +         means that $M overrides :mailname entries in the user
  391. +         database!  Problem noted by Paul Southworth.
  392. +     CONFIG: Fix definition of Solaris help file location.  From
  393. +         Steve Cliffe <steve@gorgon.cs.uow.edu.au>.
  394. +     CONFIG: Fix bug that broke news.group.USENET mappings.
  395. +     CONFIG: Allow declaration of SMTP_MAILER_MAX, FAX_MAILER_MAX,
  396. +         and USENET_MAILER_MAX to tweak the maximum message
  397. +         size for various mailers.
  398. +     CONFIG: Change definition of USENET_MAILER_ARGS to include argv[0]
  399. +         instead of assuming that it is "inews" for consistency
  400. +         with other mailers.  From Michael Corrigan of UC San Diego.
  401. +     CONFIG: When mail is forwarded to a LOCAL_RELAY or a MAIL_HUB,
  402. +         qualify the address in the SMTP envelope as user@{relay|hub}
  403. +         instead of user@$j.  From Bill Wisner of The Well.
  404. +     CONFIG: Fix route-addr syntax in nullrelay configuration set.
  405. +     CONFIG: Don't turn off case mapping of user names in the local
  406. +         mailer for IRIX.  This was different than most every other
  407. +         system.
  408. +     CONFIG: Avoid infinite loops on certainly list:; syntaxes in
  409. +         envelope.  Noted by Thierry Besancon
  410. +         <besancon@excalibur.ens.fr>.
  411. +     CONFIG: Don't include -z by default on uux line -- most systems
  412. +         don't want it set by default.  Pointed out by Philippe
  413. +         Michel of Thomson CSF.
  414. +     CONFIG: Fix some bugs with mailertables -- for example, if your
  415. +         host name was foo.bar.ray.com and you matched against
  416. +         ".ray.com", the old implementation bound %1 to "bar"
  417. +         instead of "foo.bar".  Also, allow "." in the mailertable
  418. +         to match anything -- essentially, take over SMART_HOST.
  419. +         This also moves matching of explicit local host names
  420. +         before the mailertable so they don't have to be special
  421. +         cased in the mailertable data.  Reported by Bill
  422. +         Gianopoulos of Raytheon; the fix for the %1 binding
  423. +         problem was contributed by Nicholas Comanos of the
  424. +         University of Sydney.
  425. +     CONFIG: Don't include "root" in class $=L (users to deliver
  426. +         locally, even if a hub or relay exists) by default.
  427. +         This is because of the known bug where definition of
  428. +         both a LOCAL_RELAY and a MAIL_HUB causes $=L to ignore
  429. +         both and deliver into the local mailbox.
  430. +     CONFIG: Move up bitdomain and uudomain handling so that they
  431. +         are done before .UUCP class matching; uudomain was
  432. +         reported as ineffective before.  This also frees up
  433. +         diversion 8 for future use.  Problem reported by Kimmo
  434. +         Suominen.
  435. +     CONFIG: Don't try to convert dotted IP address (e.g., [1.2.3.4])
  436. +         into host names.  As pointed out by Jonathan Kamens,
  437. +         these are often used because either the forward or reverse
  438. +         mapping is broken; this translation makes it broken again.
  439. +     DOC: Clarify $@ and $: in the Install & Op Guide.  From Kimmo
  440. +         Suominen.
  441. +     Portability fixes:
  442. +         Unicos from David L. Kensiski of Sterling Sofware.
  443. +         DomainOS from Don Lewis of Silicon Systems.
  444. +         GNU m4 1.0.3 from Karst Koymans of Utrecht University.
  445. +         Convex from Kimmo Suominen <kim@tac.nyc.ny.us>.
  446. +         NetBSD from Adam Glass <glass@sun-lamp.cs.berkeley.edu>.
  447. +         BSD/386 from Tony Sanders of BSDI.
  448. +         Apollo from Eric Wassenaar.
  449. +         DGUX from Doug Anderson.
  450. +         Sequent DYNIX/ptx 2.0 from Tim Wright of Sequent.
  451. +     NEW FILES:
  452. +         src/Makefile.DomainOS
  453. +         src/Makefile.PTX
  454. +         src/Makefile.SunOS.5.1
  455. +         src/Makefile.SunOS.5.2
  456. +         src/Makefile.SunOS.5.x
  457. +         src/mailq.1
  458. +         cf/ostype/domainos.m4
  459. +         doc/op/Makefile
  460. +         doc/intro/Makefile
  461. +         doc/usenix/Makefile
  462.   8.6.5/8.6.5    94/01/13
  463.       Security fix:  /.forward could be owned by anyone (the test
  464.           to allow root to own any file was backwards).  From
  465. ***************
  466. *** 185,190 ****
  467. --- 424,431 ----
  468.           new arguments.  For example, if you used ``sendmail
  469.           -C config -v -q'' it would choke on the -q because
  470.           the -C would stop looking for old-format arguments.
  471. +     Fix the code that was intended to allow two users to forward their
  472. +         mail to the same program and have them appear unique.
  473.       Portability fixes for:
  474.           SCO UNIX from Murray Kucherawy.
  475.           SCO Open Server 3.2v4 from Philippe Brand.
  476. *** cf/README.OLD    Wed Jan 12 06:19:02 1994
  477. --- cf/README    Sat Mar 12 08:49:57 1994
  478. ***************
  479. *** 4,10 ****
  480.   
  481.           Eric Allman <eric@CS.Berkeley.EDU>
  482.   
  483. !         @(#)README    8.21 (Berkeley) 1/12/94
  484.   
  485.   
  486.   This document describes the sendmail configuration files being used
  487. --- 4,10 ----
  488.   
  489.           Eric Allman <eric@CS.Berkeley.EDU>
  490.   
  491. !         @(#)README    8.27 (Berkeley) 3/12/94
  492.   
  493.   
  494.   This document describes the sendmail configuration files being used
  495. ***************
  496. *** 13,19 ****
  497.   old versions of sendmail and cannot be expected to work well.
  498.   
  499.   These configuration files are probably not as general as previous
  500. ! versions, and don't handle as many of the wierd cases automagically.
  501.   I was able to simplify by them for two reasons.  First, the network
  502.   has become more consistent -- for example, at this point, everyone
  503.   on the internet is supposed to be running a name server, so hacks to
  504. --- 13,19 ----
  505.   old versions of sendmail and cannot be expected to work well.
  506.   
  507.   These configuration files are probably not as general as previous
  508. ! versions, and don't handle as many of the weird cases automagically.
  509.   I was able to simplify by them for two reasons.  First, the network
  510.   has become more consistent -- for example, at this point, everyone
  511.   on the internet is supposed to be running a name server, so hacks to
  512. ***************
  513. *** 23,30 ****
  514.   does describe the vast majority of sites with which I am familiar,
  515.   including those outside the US.
  516.   
  517. ! Of course, the downside of this is that if you do live in a wierd
  518. ! world, things are going to get wierder for you.  I'm sorry about that,
  519.   but at the time we at Berkeley had a problem, and it seemed like the
  520.   right thing to do.
  521.   
  522. --- 23,30 ----
  523.   does describe the vast majority of sites with which I am familiar,
  524.   including those outside the US.
  525.   
  526. ! Of course, the downside of this is that if you do live in a weird
  527. ! world, things are going to get weirder for you.  I'm sorry about that,
  528.   but at the time we at Berkeley had a problem, and it seemed like the
  529.   right thing to do.
  530.   
  531. ***************
  532. *** 163,170 ****
  533. --- 163,174 ----
  534.   USENET_MAILER_FLAGS    [rlsDFMmn] The mailer flags for the usenet mailer.
  535.   USENET_MAILER_ARGS    [-m -h -n] The command line arguments for the
  536.               usenet mailer.
  537. + USENET_MAILER_MAX    [100000] The maximum size of messages that will
  538. +             be accepted by the usenet mailer.
  539.   SMTP_MAILER_FLAGS    [undefined] Flags added to SMTP mailer.  Default
  540.               flags are `mDFMUX' (and `a' for esmtp mailer).
  541. + SMTP_MAILER_MAX        [undefined] The maximum size of messages that will
  542. +             be transported using the smtp or esmtp mailers.
  543.   UUCP_MAILER_FLAGS    [undefined] Flags added to UUCP mailer.  Default
  544.               flags are `DFMhuU' (and `m' for suucp mailer, minus
  545.               `U' for uucp-dom mailer).
  546. ***************
  547. *** 172,182 ****
  548.               passed to the UUCP mailer.
  549.   UUCP_MAX_SIZE        [100000] The maximum size message accepted for
  550.               transmission by the UUCP mailers.
  551. ! HOSTMAP_SPEC        [dbm -o /etc/hostmap] The value for the builtin
  552. !             hostmap key definition.  You can redefine this
  553. !             to change the class, flags, and filename of
  554. !             the hostmap.  The default flag (-o) makes this
  555. !             map optional.
  556.   
  557.   +---------+
  558.   | DOMAINS |
  559. --- 176,185 ----
  560.               passed to the UUCP mailer.
  561.   UUCP_MAX_SIZE        [100000] The maximum size message accepted for
  562.               transmission by the UUCP mailers.
  563. ! FAX_MAILER_PATH        [/usr/local/lib/fax/mailfax] The program used to
  564. !             submit FAX messages.
  565. ! FAX_MAILER_MAX        [100000] The maximum size message accepted for
  566. !             transmission by FAX.
  567.   
  568.   +---------+
  569.   | DOMAINS |
  570. ***************
  571. *** 410,415 ****
  572. --- 413,432 ----
  573.   lists of UUCP hosts they speak with directly.  This can get a bit more
  574.   tricky.  For an example of a "complex" site, see cf/ucbvax.mc.
  575.   
  576. + If your host is known by several different names, you need to augment
  577. + the $=w class.  This is a list of names by which you are known, and
  578. + anything sent to an address using a host name in this list will be
  579. + treated as local mail.  You can do this in two ways: either create
  580. + the file /etc/sendmail.cw containing a list of your aliases (one per
  581. + line), and use ``FEATURE(use_cw_file)'' in the .mc file, or add the
  582. + line:
  583. +     Cw alias.host.name
  584. + at the end of that file.  See the ``vangogh.mc'' file for an example.
  585. + Be sure you use the fully-qualified name of the host, rather than a
  586. + short name.
  587.   The SITECONFIG macro allows you to indirectly reference site-dependent
  588.   configuration information stored in the siteconfig subdirectory.  For
  589.   example, the line
  590. ***************
  591. *** 418,435 ****
  592.   
  593.   reads the file uucp.ucbvax for local connection information.  The
  594.   second parameter is the local name (in this case just "ucbvax" since
  595. ! it is locally connected, and hence a UUCP hostname) and the name of
  596. ! the class in which to store the host information.  Another SITECONFIG
  597. ! line reads
  598.   
  599.       SITECONFIG(uucp.ucbarpa, ucbarpa.Berkeley.EDU, W)
  600.   
  601.   This says that the file uucp.ucbarpa contains the list of UUCP sites
  602.   connected to ucbarpa.Berkeley.EDU.  The $=W class will be used to
  603. ! store this list.  [The machine ucbarpa is gone now, but I've left
  604.   this out-of-date configuration file around to demonstrate how you
  605.   might do this.]
  606.   
  607.   The siteconfig file (e.g., siteconfig/uucp.ucbvax.m4) contains nothing
  608.   more than a sequence of SITE macros describing connectivity.  For
  609.   example:
  610. --- 435,460 ----
  611.   
  612.   reads the file uucp.ucbvax for local connection information.  The
  613.   second parameter is the local name (in this case just "ucbvax" since
  614. ! it is locally connected, and hence a UUCP hostname).  The third
  615. ! parameter is the name of both a macro to store the local name (in
  616. ! this case, $U) and the name of the class (e.g., $=U) in which to store
  617. ! the host information read from the file.  Another SITECONFIG line reads
  618.   
  619.       SITECONFIG(uucp.ucbarpa, ucbarpa.Berkeley.EDU, W)
  620.   
  621.   This says that the file uucp.ucbarpa contains the list of UUCP sites
  622.   connected to ucbarpa.Berkeley.EDU.  The $=W class will be used to
  623. ! store this list, and $W is defined to be ucbarpa.Berkeley.EDU, that
  624. ! is, the name of the relay to which the hosts listed in uucp.ucbarpa
  625. ! are connected.  [The machine ucbarpa is gone now, but I've left
  626.   this out-of-date configuration file around to demonstrate how you
  627.   might do this.]
  628.   
  629. + Note that the case of SITECONFIG with a third parameter of ``U'' is
  630. + special; the second parameter is assumed to be the UUCP name of the
  631. + local site, rather than the name of a remote site, and the UUCP name
  632. + is entered into $=w (the list of local hostnames) as $U.UUCP.
  633.   The siteconfig file (e.g., siteconfig/uucp.ucbvax.m4) contains nothing
  634.   more than a sequence of SITE macros describing connectivity.  For
  635.   example:
  636. ***************
  637. *** 547,553 ****
  638.   to be converted to "user@decvax.dec.com" and "user@research.att.com"
  639.   respectively.
  640.   
  641. ! This could also be used to look hosts in a database map:
  642.   
  643.       LOCAL_RULE_3
  644.       R$* < @ $+ > $*        $: $1 < @ $(hostmap $2 $) > $3
  645. --- 572,578 ----
  646.   to be converted to "user@decvax.dec.com" and "user@research.att.com"
  647.   respectively.
  648.   
  649. ! This could also be used to look up hosts in a database map:
  650.   
  651.       LOCAL_RULE_3
  652.       R$* < @ $+ > $*        $: $1 < @ $(hostmap $2 $) > $3
  653. ***************
  654. *** 559,565 ****
  655.   via MX records.  For example, you might have:
  656.   
  657.       LOCAL_RULE_0
  658. !     R$+ < @ cnmat.Berkeley.EDU >    $#uucp $@ cnmat $: $1
  659.   
  660.   You would use this if you had installed an MX record for cnmat.Berkeley.EDU
  661.   pointing at this host; this rule catches the message and forwards it on
  662. --- 584,590 ----
  663.   via MX records.  For example, you might have:
  664.   
  665.       LOCAL_RULE_0
  666. !     R$+ <@ host.dom.ain.>    $#uucp $@ cnmat $: $1 < @ host.dom.ain.>
  667.   
  668.   You would use this if you had installed an MX record for cnmat.Berkeley.EDU
  669.   pointing at this host; this rule catches the message and forwards it on
  670. ***************
  671. *** 585,593 ****
  672.   
  673.       MASQUERADE_AS(host.domain)
  674.   
  675. ! This causes outgoing SMTP mail to be labelled as coming from the
  676.   indicated domain, rather than $j.  One normally masquerades as one
  677. ! of your own subdomains (for example, it's unlikely that I would
  678.   choose to masquerade as an MIT site).
  679.   
  680.   The masquerade name is not normally canonified, so it is important
  681. --- 610,618 ----
  682.   
  683.       MASQUERADE_AS(host.domain)
  684.   
  685. ! This causes outgoing SMTP mail to be labeled as coming from the
  686.   indicated domain, rather than $j.  One normally masquerades as one
  687. ! of one's own subdomains (for example, it's unlikely that I would
  688.   choose to masquerade as an MIT site).
  689.   
  690.   The masquerade name is not normally canonified, so it is important
  691. ***************
  692. *** 628,636 ****
  693.       define(`MAIL_HUB', mailer:hostname)
  694.   
  695.   Again, ``mailer:'' defaults to "smtp".  If you define both LOCAL_RELAY
  696. ! and MAIL_HUB, unqualified names and names in class L will be sent to
  697. ! the LOCAL_RELAY and other local names will be sent to MAIL_HUB.  For
  698. ! example, if are on machine mastodon.CS.Berkeley.EDU, the following
  699.   combinations of settings will have the indicated effects:
  700.   
  701.   email sent to....    eric              eric@mastodon.CS.Berkeley.EDU
  702. --- 653,663 ----
  703.       define(`MAIL_HUB', mailer:hostname)
  704.   
  705.   Again, ``mailer:'' defaults to "smtp".  If you define both LOCAL_RELAY
  706. ! and MAIL_HUB, unqualified names will be sent to the LOCAL_RELAY and
  707. ! other local names will be sent to MAIL_HUB.  Names in $=L will be
  708. ! delivered locally, so you MUST have aliases or .forward files for them.
  709. ! For example, if are on machine mastodon.CS.Berkeley.EDU, the following
  710.   combinations of settings will have the indicated effects:
  711.   
  712.   email sent to....    eric              eric@mastodon.CS.Berkeley.EDU
  713. ***************
  714. *** 1081,1087 ****
  715.   hack        Local hacks.  These can be referenced using the HACK
  716.           macro.  They shouldn't be of more than voyeuristic
  717.           interest outside the .Berkeley.EDU domain, but who knows?
  718. !         We've all got our own peccadilloes.
  719.   
  720.   siteconfig    Site configuration -- e.g., tables of locally connected
  721.           UUCP sites.
  722. --- 1108,1114 ----
  723.   hack        Local hacks.  These can be referenced using the HACK
  724.           macro.  They shouldn't be of more than voyeuristic
  725.           interest outside the .Berkeley.EDU domain, but who knows?
  726. !         We've all got our own peccadillos.
  727.   
  728.   siteconfig    Site configuration -- e.g., tables of locally connected
  729.           UUCP sites.
  730. ***************
  731. *** 1197,1201 ****
  732.      5    locally interpreted names (overrides $R)
  733.      6    local configuration (at top of file)
  734.      7    mailer definitions
  735. !    8    special local name recognition (late in ruleset 3)
  736.      9    special local rulesets (1 and 2)
  737. --- 1224,1228 ----
  738.      5    locally interpreted names (overrides $R)
  739.      6    local configuration (at top of file)
  740.      7    mailer definitions
  741. !    8
  742.      9    special local rulesets (1 and 2)
  743. *** cf/cf/vangogh.mc.OLD    Mon Jun  7 10:07:59 1993
  744. --- cf/cf/vangogh.mc    Wed Jan 26 17:38:50 1994
  745. ***************
  746. *** 34,43 ****
  747.   #
  748.   
  749.   include(`../m4/cf.m4')
  750. ! VERSIONID(`@(#)vangogh.mc    8.1 (Berkeley) 6/7/93')
  751.   DOMAIN(cs.exposed)dnl
  752.   OSTYPE(bsd4.4)dnl
  753.   MAILER(local)dnl
  754.   MAILER(smtp)dnl
  755.   define(`MCI_CACHE_SIZE', 5)
  756. ! Cw okeeffe
  757. --- 34,44 ----
  758.   #
  759.   
  760.   include(`../m4/cf.m4')
  761. ! VERSIONID(`@(#)vangogh.mc    8.2 (Berkeley) 1/26/94')
  762.   DOMAIN(cs.exposed)dnl
  763.   OSTYPE(bsd4.4)dnl
  764.   MAILER(local)dnl
  765.   MAILER(smtp)dnl
  766.   define(`MCI_CACHE_SIZE', 5)
  767. ! Cw okeeffe.CS.Berkeley.EDU
  768. ! Cw python.CS.Berkeley.EDU
  769. *** cf/domain/Berkeley.m4.OLD    Mon Dec 20 10:49:11 1993
  770. --- cf/domain/Berkeley.m4    Fri Feb 18 13:04:17 1994
  771. ***************
  772. *** 33,41 ****
  773.   # SUCH DAMAGE.
  774.   #
  775.   divert(0)
  776. ! VERSIONID(`@(#)Berkeley.m4    8.4 (Berkeley) 12/20/93')
  777.   define(`UUCP_RELAY', `ucbvax.Berkeley.EDU')dnl
  778. ! define(`BITNET_RELAY', `jade.Berkeley.EDU')dnl
  779.   define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward')dnl
  780.   define(`confCW_FILE', `-o /etc/sendmail.cw')dnl
  781.   FEATURE(redirect)dnl
  782. --- 33,41 ----
  783.   # SUCH DAMAGE.
  784.   #
  785.   divert(0)
  786. ! VERSIONID(`@(#)Berkeley.m4    8.5 (Berkeley) 2/18/94')
  787.   define(`UUCP_RELAY', `ucbvax.Berkeley.EDU')dnl
  788. ! define(`BITNET_RELAY', `CMSA.Berkeley.EDU')dnl
  789.   define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward')dnl
  790.   define(`confCW_FILE', `-o /etc/sendmail.cw')dnl
  791.   FEATURE(redirect)dnl
  792. *** cf/feature/allmasquerade.m4.OLD    Wed Jul  7 14:59:27 1993
  793. --- cf/feature/allmasquerade.m4    Sat Jan 22 09:47:51 1994
  794. ***************
  795. *** 34,41 ****
  796.   #
  797.   
  798.   divert(0)
  799. ! VERSIONID(`@(#)allmasquerade.m4    8.1 (Berkeley) 7/7/93')
  800.   divert(-1)
  801.   
  802.   
  803. ! define(`_ALL_MASQUERADE_')
  804. --- 34,41 ----
  805.   #
  806.   
  807.   divert(0)
  808. ! VERSIONID(`@(#)allmasquerade.m4    8.2 (Berkeley) 1/22/94')
  809.   divert(-1)
  810.   
  811.   
  812. ! define(`_ALL_MASQUERADE_', 1)
  813. *** cf/feature/bitdomain.m4.OLD    Tue Nov 30 09:01:07 1993
  814. --- cf/feature/bitdomain.m4    Sat Feb 19 07:56:20 1994
  815. ***************
  816. *** 34,40 ****
  817.   #
  818.   
  819.   divert(0)
  820. ! VERSIONID(`@(#)bitdomain.m4    8.4 (Berkeley) 11/30/93')
  821.   divert(-1)
  822.   
  823.   
  824. --- 34,40 ----
  825.   #
  826.   
  827.   divert(0)
  828. ! VERSIONID(`@(#)bitdomain.m4    8.6 (Berkeley) 2/19/94')
  829.   divert(-1)
  830.   
  831.   
  832. ***************
  833. *** 43,49 ****
  834.   POPDIVERT
  835.   
  836.   
  837. ! PUSHDIVERT(8)
  838.   # handle BITNET mapping
  839. ! R$* < @ $+ .BITNET. > $*    $: $1 < @ $(bitdomain $2 $: $2.BITNET. $) > $3
  840.   POPDIVERT
  841. --- 43,49 ----
  842.   POPDIVERT
  843.   
  844.   
  845. ! PUSHDIVERT(2)
  846.   # handle BITNET mapping
  847. ! R$* < @ $+ .BITNET > $*        $: $1 < @ $(bitdomain $2 $: $2.BITNET $) > $3
  848.   POPDIVERT
  849. *** cf/feature/uucpdomain.m4.OLD    Tue Nov 30 09:01:08 1993
  850. --- cf/feature/uucpdomain.m4    Sat Feb 19 07:56:20 1994
  851. ***************
  852. *** 34,40 ****
  853.   #
  854.   
  855.   divert(0)
  856. ! VERSIONID(`@(#)uucpdomain.m4    8.4 (Berkeley) 11/30/93')
  857.   divert(-1)
  858.   
  859.   
  860. --- 34,40 ----
  861.   #
  862.   
  863.   divert(0)
  864. ! VERSIONID(`@(#)uucpdomain.m4    8.6 (Berkeley) 2/19/94')
  865.   divert(-1)
  866.   
  867.   
  868. ***************
  869. *** 43,49 ****
  870.   POPDIVERT
  871.   
  872.   
  873. ! PUSHDIVERT(8)
  874.   # handle UUCP mapping
  875. ! R$* < @ $+ .UUCP. > $*        $: $1 < @ $(uudomain $2 $: $2.UUCP. $) > $3
  876.   POPDIVERT
  877. --- 43,49 ----
  878.   POPDIVERT
  879.   
  880.   
  881. ! PUSHDIVERT(2)
  882.   # handle UUCP mapping
  883. ! R$* < @ $+ .UUCP > $*        $: $1 < @ $(uudomain $2 $: $2.UUCP $) > $3
  884.   POPDIVERT
  885. *** cf/m4/nullrelay.m4.OLD    Fri Sep  3 09:20:38 1993
  886. --- cf/m4/nullrelay.m4    Tue Feb  1 10:16:32 1994
  887. ***************
  888. *** 34,40 ****
  889.   #
  890.   divert(0)
  891.   
  892. ! VERSIONID(`@(#)nullrelay.m4    8.4 (Berkeley) 9/3/93')
  893.   
  894.   #
  895.   #  This configuration applies only to relay-only hosts.  They send
  896. --- 34,40 ----
  897.   #
  898.   divert(0)
  899.   
  900. ! VERSIONID(`@(#)nullrelay.m4    8.5 (Berkeley) 2/1/94')
  901.   
  902.   #
  903.   #  This configuration applies only to relay-only hosts.  They send
  904. ***************
  905. *** 266,272 ****
  906.   ifdef(`_NO_CANONIFY_', `dnl',
  907.   `# eliminate local host if present
  908.   R@ $=w $=: $+        $@ @ $M $2 $3            @thishost ...
  909. ! R@ $+            $@ $1                @somewhere ...
  910.   
  911.   R$+ @ $=w        $@ $1 @ $M            ...@thishost
  912.   R$+ @ $+        $@ $1 @ $2            ...@somewhere
  913. --- 266,272 ----
  914.   ifdef(`_NO_CANONIFY_', `dnl',
  915.   `# eliminate local host if present
  916.   R@ $=w $=: $+        $@ @ $M $2 $3            @thishost ...
  917. ! R@ $+            $@ @ $1                @somewhere ...
  918.   
  919.   R$+ @ $=w        $@ $1 @ $M            ...@thishost
  920.   R$+ @ $+        $@ $1 @ $2            ...@somewhere
  921. *** cf/m4/proto.m4.OLD    Thu Jan 13 06:40:24 1994
  922. --- cf/m4/proto.m4    Fri Mar  4 09:10:36 1994
  923. ***************
  924. *** 34,40 ****
  925.   #
  926.   divert(0)
  927.   
  928. ! VERSIONID(`@(#)proto.m4    8.30 (Berkeley) 1/12/94')
  929.   
  930.   MAILER(local)dnl
  931.   
  932. --- 34,40 ----
  933.   #
  934.   divert(0)
  935.   
  936. ! VERSIONID(`@(#)proto.m4    8.45 (Berkeley) 3/4/94')
  937.   
  938.   MAILER(local)dnl
  939.   
  940. ***************
  941. *** 118,129 ****
  942.   # who gets all local email traffic ($R has precedence for unqualified names)
  943.   DH`'ifdef(`MAIL_HUB', MAIL_HUB)
  944.   
  945. ! # who I masquerade as (can be $j)
  946. ! DM`'ifdef(`MASQUERADE_NAME', MASQUERADE_NAME, $j)
  947.   
  948.   # class L: names that should be delivered locally, even if we have a relay
  949.   # class E: names that should be exposed as from this host, even if we masquerade
  950. ! CLroot
  951.   CEroot
  952.   undivert(5)dnl
  953.   
  954. --- 118,129 ----
  955.   # who gets all local email traffic ($R has precedence for unqualified names)
  956.   DH`'ifdef(`MAIL_HUB', MAIL_HUB)
  957.   
  958. ! # who I masquerade as (null for no masquerading)
  959. ! DM`'ifdef(`MASQUERADE_NAME', MASQUERADE_NAME)
  960.   
  961.   # class L: names that should be delivered locally, even if we have a relay
  962.   # class E: names that should be exposed as from this host, even if we masquerade
  963. ! #CLroot
  964.   CEroot
  965.   undivert(5)dnl
  966.   
  967. ***************
  968. *** 171,177 ****
  969.   Oa`'confALIAS_WAIT
  970.   
  971.   # location of alias file
  972. ! OA`'ifdef(`ALIAS_FILE', ALIAS_FILE, /etc/aliases)
  973.   
  974.   # minimum number of free blocks on filesystem
  975.   Ob`'confMIN_FREE_BLOCKS
  976. --- 171,177 ----
  977.   Oa`'confALIAS_WAIT
  978.   
  979.   # location of alias file
  980. ! OA`'ifdef(`ALIAS_FILE', `ALIAS_FILE', /etc/aliases)
  981.   
  982.   # minimum number of free blocks on filesystem
  983.   Ob`'confMIN_FREE_BLOCKS
  984. ***************
  985. *** 360,366 ****
  986.   #########################
  987.   
  988.   H?P?Return-Path: $g
  989. ! HReceived: $?sfrom $s $.$?_($_) $.by $j ($v/$Z)$?r with $r$. id $i$?u for $u$.; $b
  990.   H?D?Resent-Date: $a
  991.   H?D?Date: $a
  992.   H?F?Resent-From: $q
  993. --- 360,366 ----
  994.   #########################
  995.   
  996.   H?P?Return-Path: $g
  997. ! HReceived: $?sfrom $s $.$?_($?s$|from $.$_) $.by $j ($v/$Z)$?r with $r$. id $i$?u for $u$.; $b
  998.   H?D?Resent-Date: $a
  999.   H?D?Date: $a
  1000.   H?F?Resent-From: $q
  1001. ***************
  1002. *** 443,451 ****
  1003.   R$* < @ localhost . $m > $*    $: $1 < @ $j . > $2        local domain
  1004.   ifdef(`_NO_UUCP_', `dnl',
  1005.   `R$* < @ localhost . UUCP > $*    $: $1 < @ $j . > $2        .UUCP domain')
  1006. ! R$* < @ [ $+ ] > $*        $: $1 < @ [[ $2 ]] > $3        catch [a.b.c.d]
  1007. ! R$* < @ [ $=w ] > $*        $: $1 < @ $j . > $3        self-literal
  1008. ! R$* < @ [[ $+ ]] > $*        $: $1 < @ [ $2 ] > $3        strip dbl [[]]
  1009.   ifdef(`DOMAIN_TABLE', `
  1010.   # look up unqualified domains in the domain table
  1011.   R$* < @ $- > $*            $: $1 < @ $(domaintable $2 $) > $3',
  1012. --- 443,451 ----
  1013.   R$* < @ localhost . $m > $*    $: $1 < @ $j . > $2        local domain
  1014.   ifdef(`_NO_UUCP_', `dnl',
  1015.   `R$* < @ localhost . UUCP > $*    $: $1 < @ $j . > $2        .UUCP domain')
  1016. ! R$* < @ [ $+ ] > $*        $: $1 < @@ [ $2 ] > $3        mark [a.b.c.d]
  1017. ! R$* < @@ $=w > $*        $: $1 < @ $j . > $3        self-literal
  1018. ! R$* < @@ $+ > $*        $@ $1 < @ $2 > $3        canon IP addr
  1019.   ifdef(`DOMAIN_TABLE', `
  1020.   # look up unqualified domains in the domain table
  1021.   R$* < @ $- > $*            $: $1 < @ $(domaintable $2 $) > $3',
  1022. ***************
  1023. *** 483,490 ****
  1024.   R$* < @ $* $=P > $*        $: $1 < @ $2 $3 . > $4
  1025.   R$* < @ $* . . > $*        $1 < @ $2 . > $3
  1026.   
  1027. - undivert(8)dnl
  1028.   # if this is the local hostname, make sure we treat is as canonical
  1029.   R$* < @ $j > $*            $: $1 < @ $j . > $2
  1030.   
  1031. --- 483,488 ----
  1032. ***************
  1033. *** 496,504 ****
  1034.   
  1035.   R$*<@>            $@ $1                handle <> and list:;
  1036.   
  1037. - # resolve numeric addresses to name if possible
  1038. - R$* < @ [ $+ ] > $*    $: $1 < @ $[ [$2] $] > $3    lookup numeric internet addr
  1039.   # strip trailing dot off possibly canonical name
  1040.   R$* < @ $+ . > $*    $1 < @ $2 > $3
  1041.   
  1042. --- 494,499 ----
  1043. ***************
  1044. *** 533,545 ****
  1045.   S0
  1046.   
  1047.   R<@>            $#_LOCAL_ $: <>            special case error msgs
  1048. ! R$*:;<@>        $#error $@ USAGE $: "list:; syntax illegal for recipient addresses"
  1049.   R<@ $+>            $#error $@ USAGE $: "user address required"
  1050.   
  1051.   ifdef(`_MAILER_smtp_',
  1052.   `# handle numeric address spec
  1053. - ifdef(`_NO_CANONIFY_', `dnl',
  1054. - `R$* < @ [ $+ ] > $*    $: $1 < @ $[ [$2] $] > $3    numeric internet addr')
  1055.   R$* < @ [ $+ ] > $*    $: $>_SET_98_ $1 < @ [ $2 ] > $3    numeric internet spec
  1056.   R$* < @ [ $+ ] > $*    $#_SMTP_ $@ [$2] $: $1 < @ [$2] > $3    still numeric: send',
  1057.       `dnl')
  1058. --- 528,539 ----
  1059.   S0
  1060.   
  1061.   R<@>            $#_LOCAL_ $: <>            special case error msgs
  1062. ! R$* : $* ;        $#error $@ USAGE $: "list:; syntax illegal for recipient addresses"
  1063.   R<@ $+>            $#error $@ USAGE $: "user address required"
  1064. + R<$* : $* >        $#error $@ USAGE $: "colon illegal in host name part"
  1065.   
  1066.   ifdef(`_MAILER_smtp_',
  1067.   `# handle numeric address spec
  1068.   R$* < @ [ $+ ] > $*    $: $>_SET_98_ $1 < @ [ $2 ] > $3    numeric internet spec
  1069.   R$* < @ [ $+ ] > $*    $#_SMTP_ $@ [$2] $: $1 < @ [$2] > $3    still numeric: send',
  1070.       `dnl')
  1071. ***************
  1072. *** 551,565 ****
  1073.   
  1074.   # handle local hacks
  1075.   R$*            $: $>_SET_98_ $1
  1076. - ifdef(`MAILER_TABLE',
  1077. - `
  1078. - # try mailer table lookup
  1079. - R$* <@ $+ > $*        $: < $2 > $1 < @ $2 > $3    extract host name
  1080. - R< $+ . > $*        $: < $1 > $2            strip trailing dot
  1081. - R< $+ > $*        $: < $(mailertable $1 $) > $2    lookup
  1082. - R< $- : $+ > $*        $# $1 $@ $2 $: $3        check -- resolved?
  1083. - R< $+ > $*        $: $>90 <$1> $2            try domain',
  1084. - `dnl')
  1085.   
  1086.   # short circuit local delivery so forwarded email works
  1087.   ifdef(`_LOCAL_NOT_STICKY_',
  1088. --- 545,550 ----
  1089. ***************
  1090. *** 572,577 ****
  1091. --- 557,571 ----
  1092.   R$+ < $+ @ >        $#_LOCAL_ $: $1            nope, local address',
  1093.   `R$+ < $+ @ $+ >        $#_LOCAL_ $: $1            yep ....
  1094.   R$+ < $+ @ >        $#_LOCAL_ $: @ $1            nope, local address')')
  1095. + ifdef(`MAILER_TABLE',
  1096. + `
  1097. + # not local -- try mailer table lookup
  1098. + R$* <@ $+ > $*        $: < $2 > $1 < @ $2 > $3    extract host name
  1099. + R< $+ . > $*        $: < $1 > $2            strip trailing dot
  1100. + R< $+ > $*        $: < $(mailertable $1 $) > $2    lookup
  1101. + R< $- : $+ > $*        $# $1 $@ $2 $: $3        check -- resolved?
  1102. + R< $+ > $*        $: $>90 <$1> $2            try domain',
  1103. + `dnl')
  1104.   undivert(4)dnl
  1105.   
  1106.   ifdef(`_NO_UUCP_', `dnl',
  1107. ***************
  1108. *** 608,614 ****
  1109.       `dnl')')
  1110.   ifdef(`_MAILER_usenet_', `
  1111.   # addresses sent to net.group.USENET will get forwarded to a newsgroup
  1112. ! R$+ . USENET.        $#usenet $: $1',
  1113.       `dnl')
  1114.   
  1115.   ifdef(`_LOCAL_RULES_',
  1116. --- 602,608 ----
  1117.       `dnl')')
  1118.   ifdef(`_MAILER_usenet_', `
  1119.   # addresses sent to net.group.USENET will get forwarded to a newsgroup
  1120. ! R$+ . USENET        $#usenet $: $1',
  1121.       `dnl')
  1122.   
  1123.   ifdef(`_LOCAL_RULES_',
  1124. ***************
  1125. *** 646,653 ****
  1126.   S5
  1127.   
  1128.   # see if we have a relay or a hub
  1129. ! R$+            $: $>_SET_95_ < $R > $1            try relay
  1130. ! R$+            $: $>_SET_95_ < $H > $1            try hub')
  1131.   ifdef(`MAILER_TABLE',
  1132.   `
  1133.   
  1134. --- 640,650 ----
  1135.   S5
  1136.   
  1137.   # see if we have a relay or a hub
  1138. ! R$+            $: < $R > $1            try relay
  1139. ! R< > $+            $: < $H > $1            try hub
  1140. ! R< > $+            $@ $1                nope, give up
  1141. ! R< $- : $+ > $+        $: $>_SET_95_ < $1 : $2 > $3 < @ $2 >
  1142. ! R< $+ > $+        $@ $>_SET_95_ < $1 > $2 < @ $1 >')
  1143.   ifdef(`MAILER_TABLE',
  1144.   `
  1145.   
  1146. ***************
  1147. *** 657,666 ****
  1148.   ###################################################################
  1149.   
  1150.   S90
  1151. ! R<$- . $+ > $*        $: < $(mailertable .$2 $@ $1 $) > $3    lookup
  1152. ! R<$- : $+ > $*        $# $1 $@ $2 $: $3        check -- resolved?
  1153. ! R< . $+ > $*        $@ $>90 <$1> $2            no -- strip & try again
  1154. ! R<$*> $*        $@ $2                no match',
  1155.   `dnl')
  1156.   
  1157.   ###################################################################
  1158. --- 654,665 ----
  1159.   ###################################################################
  1160.   
  1161.   S90
  1162. ! R$* <$- . $+ > $*    $: $1$2 < $(mailertable .$3 $@ $1$2 $@ $2 $) > $4
  1163. ! R$* <$- : $+ > $*    $# $2 $@ $3 $: $4        check -- resolved?
  1164. ! R$* < . $+ > $*        $@ $>90 $1 . <$2> $3        no -- strip & try again
  1165. ! R$* < $* > $*        $: < $(mailertable . $@ $1$2 $) > $3    try "."
  1166. ! R<$- : $+ > $*        $# $1 $@ $2 $: $3        "." found?
  1167. ! R< $* > $*        $@ $2                no mailertable match',
  1168.   `dnl')
  1169.   
  1170.   ###################################################################
  1171. *** cf/m4/version.m4.OLD    Sat Jan 22 08:29:11 1994
  1172. --- cf/m4/version.m4    Sun Mar 13 09:44:59 1994
  1173. ***************
  1174. *** 32,39 ****
  1175.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1176.   # SUCH DAMAGE.
  1177.   #
  1178. ! VERSIONID(`@(#)version.m4    8.6.1.5 (Berkeley) 1/13/94')
  1179.   #
  1180.   divert(0)
  1181.   # Configuration version number
  1182. ! DZ8.6.5
  1183. --- 32,39 ----
  1184.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1185.   # SUCH DAMAGE.
  1186.   #
  1187. ! VERSIONID(`@(#)version.m4    8.6.6.1 (Berkeley) 3/13/94')
  1188.   #
  1189.   divert(0)
  1190.   # Configuration version number
  1191. ! DZ8.6.6
  1192. *** cf/mailer/fax.m4.OLD    Mon Jun  7 10:11:19 1993
  1193. --- cf/mailer/fax.m4    Mon Jan 24 12:06:57 1994
  1194. ***************
  1195. *** 37,48 ****
  1196.   
  1197.   ifdef(`FAX_MAILER_PATH',,
  1198.       `define(`FAX_MAILER_PATH', /usr/local/lib/fax/mailfax)')
  1199.   POPDIVERT
  1200.   ####################################
  1201.   ###   FAX Mailer specification   ###
  1202.   ####################################
  1203.   
  1204. ! VERSIONID(`@(#)fax.m4    8.1 (Berkeley) 6/7/93')
  1205.   
  1206. ! Mfax,        P=FAX_MAILER_PATH, F=DFMhu, S=14, R=24, M=100000,
  1207.           A=mailfax $u $h $f
  1208. --- 37,50 ----
  1209.   
  1210.   ifdef(`FAX_MAILER_PATH',,
  1211.       `define(`FAX_MAILER_PATH', /usr/local/lib/fax/mailfax)')
  1212. + ifdef(`FAX_MAILER_MAX',,
  1213. +     `define(`FAX_MAILER_MAX', 100000)')
  1214.   POPDIVERT
  1215.   ####################################
  1216.   ###   FAX Mailer specification   ###
  1217.   ####################################
  1218.   
  1219. ! VERSIONID(`@(#)fax.m4    8.2 (Berkeley) 1/24/94')
  1220.   
  1221. ! Mfax,        P=FAX_MAILER_PATH, F=DFMhu, S=14, R=24, M=FAX_MAILER_MAX,
  1222.           A=mailfax $u $h $f
  1223. No differences encountered
  1224. *** cf/mailer/pop.m4.OLD    Wed Dec 15 06:36:42 1993
  1225. --- cf/mailer/pop.m4    Sat Feb 19 07:55:43 1994
  1226. ***************
  1227. *** 39,54 ****
  1228.   
  1229.   POPDIVERT
  1230.   
  1231. - LOCAL_CONFIG
  1232. - # POP mailer is a pseudo-domain
  1233. - CPPOP
  1234. - POPDIVERT
  1235.   ####################################
  1236.   ###   POP Mailer specification   ###
  1237.   ####################################
  1238.   
  1239. ! VERSIONID(`@(#)pop.m4    8.1 (Berkeley) 12/15/93')
  1240.   
  1241.   Mpop,        P=POP_MAILER_PATH, F=CONCAT(`lsDFM', POP_MAILER_FLAGS), S=10, R=20/40,
  1242.           A=POP_MAILER_ARGS
  1243. --- 39,53 ----
  1244.   
  1245.   POPDIVERT
  1246.   
  1247.   ####################################
  1248.   ###   POP Mailer specification   ###
  1249.   ####################################
  1250.   
  1251. ! VERSIONID(`@(#)pop.m4    8.2 (Berkeley) 2/19/94')
  1252.   
  1253.   Mpop,        P=POP_MAILER_PATH, F=CONCAT(`lsDFM', POP_MAILER_FLAGS), S=10, R=20/40,
  1254.           A=POP_MAILER_ARGS
  1255. + LOCAL_CONFIG
  1256. + # POP mailer is a pseudo-domain
  1257. + CPPOP
  1258. *** cf/mailer/smtp.m4.OLD    Mon Dec 27 14:49:22 1993
  1259. --- cf/mailer/smtp.m4    Mon Feb 14 08:31:21 1994
  1260. ***************
  1261. *** 40,51 ****
  1262.   ###   SMTP Mailer specification   ###
  1263.   #####################################
  1264.   
  1265. ! VERSIONID(`@(#)smtp.m4    8.13 (Berkeley) 12/27/93')
  1266.   
  1267.   Msmtp,        P=[IPC], F=CONCAT(mDFMuX, SMTP_MAILER_FLAGS), S=11/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), E=\r\n,
  1268. !         ifdef(`_OLD_SENDMAIL_',, `L=990, ')A=IPC $h
  1269.   Mesmtp,        P=[IPC], F=CONCAT(mDFMuXa, SMTP_MAILER_FLAGS), S=11/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), E=\r\n,
  1270. !         ifdef(`_OLD_SENDMAIL_',, `L=990, ')A=IPC $h
  1271.   Mrelay,        P=[IPC], F=CONCAT(mDFMuXa, SMTP_MAILER_FLAGS), S=11/31, R=61, E=\r\n,
  1272.           ifdef(`_OLD_SENDMAIL_',, `L=2040, ')A=IPC $h
  1273.   
  1274. --- 40,51 ----
  1275.   ###   SMTP Mailer specification   ###
  1276.   #####################################
  1277.   
  1278. ! VERSIONID(`@(#)smtp.m4    8.15 (Berkeley) 2/14/94')
  1279.   
  1280.   Msmtp,        P=[IPC], F=CONCAT(mDFMuX, SMTP_MAILER_FLAGS), S=11/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), E=\r\n,
  1281. !         ifdef(`_OLD_SENDMAIL_',, `L=990, ')ifdef(`SMTP_MAILER_MAX', `M=SMTP_MAILER_MAX, ')A=IPC $h
  1282.   Mesmtp,        P=[IPC], F=CONCAT(mDFMuXa, SMTP_MAILER_FLAGS), S=11/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), E=\r\n,
  1283. !         ifdef(`_OLD_SENDMAIL_',, `L=990, ')ifdef(`SMTP_MAILER_MAX', `M=SMTP_MAILER_MAX, ')A=IPC $h
  1284.   Mrelay,        P=[IPC], F=CONCAT(mDFMuXa, SMTP_MAILER_FLAGS), S=11/31, R=61, E=\r\n,
  1285.           ifdef(`_OLD_SENDMAIL_',, `L=2040, ')A=IPC $h
  1286.   
  1287. ***************
  1288. *** 82,89 ****
  1289.   R$* <@> $*        $@ $1 <@> $2            pass null host through
  1290.   R< @ $* > $*        $@ < @ $1 > $2            pass route-addr through
  1291.   R$=E < @ $=w . >    $@ $1 < @ $2 >            exposed user as is
  1292. ! R$* < @ $=w . >        $: $1 < @ $M >            masquerade as domain
  1293. ! R$* < @ >        $: $1 < @ $j >            in case $M undefined
  1294.   R$*            $@ $>61 $1            qualify unqual'ed names
  1295.   
  1296.   
  1297. --- 82,90 ----
  1298.   R$* <@> $*        $@ $1 <@> $2            pass null host through
  1299.   R< @ $* > $*        $@ < @ $1 > $2            pass route-addr through
  1300.   R$=E < @ $=w . >    $@ $1 < @ $2 >            exposed user as is
  1301. ! R$* < @ $=w . >        $: $1 < @ $2 @ $M >        masquerade as domain
  1302. ! R$* < @ $+ @ >        $@ $1 < @ $2 >            in case $M undefined
  1303. ! R$* < @ $+ @ $+ >    $@ $1 < @ $3 >            $M is defined -- use it
  1304.   R$*            $@ $>61 $1            qualify unqual'ed names
  1305.   
  1306.   
  1307. *** cf/mailer/usenet.m4.OLD    Mon Jun  7 10:11:32 1993
  1308. --- cf/mailer/usenet.m4    Mon Jan 24 12:07:30 1994
  1309. ***************
  1310. *** 35,47 ****
  1311.   
  1312.   ifdef(`USENET_MAILER_PATH',, `define(`USENET_MAILER_PATH', /usr/lib/news/inews)')
  1313.   ifdef(`USENET_MAILER_FLAGS',, `define(`USENET_MAILER_FLAGS', `rlsDFMmn')')
  1314. ! ifdef(`USENET_MAILER_ARGS',, `define(`USENET_MAILER_ARGS', `-m -h -n')')
  1315.   POPDIVERT
  1316.   ####################################
  1317.   ###  USENET Mailer specification ###
  1318.   ####################################
  1319.   
  1320. ! VERSIONID(`@(#)usenet.m4    8.1 (Berkeley) 6/7/93')
  1321.   
  1322. ! Musenet,    P=USENET_MAILER_PATH, F=USENET_MAILER_FLAGS, S=10, R=20,
  1323. !         A=inews USENET_MAILER_ARGS $u
  1324. --- 35,47 ----
  1325.   
  1326.   ifdef(`USENET_MAILER_PATH',, `define(`USENET_MAILER_PATH', /usr/lib/news/inews)')
  1327.   ifdef(`USENET_MAILER_FLAGS',, `define(`USENET_MAILER_FLAGS', `rlsDFMmn')')
  1328. ! ifdef(`USENET_MAILER_ARGS',, `define(`USENET_MAILER_ARGS', `inews -m -h -n')')
  1329.   POPDIVERT
  1330.   ####################################
  1331.   ###  USENET Mailer specification ###
  1332.   ####################################
  1333.   
  1334. ! VERSIONID(`@(#)usenet.m4    8.3 (Berkeley) 1/24/94')
  1335.   
  1336. ! Musenet,    P=USENET_MAILER_PATH, F=USENET_MAILER_FLAGS, S=10, R=20,ifdef(`USENET_MAILER_MAX', ` M=USENET_MAILER_MAX,')
  1337. !         A=USENET_MAILER_ARGS $u
  1338. *** cf/mailer/uucp.m4.OLD    Mon Jan 10 08:01:11 1994
  1339. --- cf/mailer/uucp.m4    Wed Feb 16 07:58:07 1994
  1340. ***************
  1341. *** 34,40 ****
  1342.   #
  1343.   
  1344.   ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')
  1345. ! ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -z -a$f -gC $h!rmail ($u)')')
  1346.   ifdef(`UUCP_MAILER_FLAGS',, `define(`UUCP_MAILER_FLAGS', `')')
  1347.   ifdef(`UUCP_MAX_SIZE',, `define(`UUCP_MAX_SIZE', 100000)')
  1348.   POPDIVERT
  1349. --- 34,40 ----
  1350.   #
  1351.   
  1352.   ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')
  1353. ! ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$f -gC $h!rmail ($u)')')
  1354.   ifdef(`UUCP_MAILER_FLAGS',, `define(`UUCP_MAILER_FLAGS', `')')
  1355.   ifdef(`UUCP_MAX_SIZE',, `define(`UUCP_MAX_SIZE', 100000)')
  1356.   POPDIVERT
  1357. ***************
  1358. *** 42,48 ****
  1359.   ###   UUCP Mailer specification   ###
  1360.   #####################################
  1361.   
  1362. ! VERSIONID(`@(#)uucp.m4    8.13 (Berkeley) 1/10/94')
  1363.   
  1364.   #
  1365.   #  There are innumerable variations on the UUCP mailer.  It really
  1366. --- 42,48 ----
  1367.   ###   UUCP Mailer specification   ###
  1368.   #####################################
  1369.   
  1370. ! VERSIONID(`@(#)uucp.m4    8.15 (Berkeley) 2/16/94')
  1371.   
  1372.   #
  1373.   #  There are innumerable variations on the UUCP mailer.  It really
  1374. ***************
  1375. *** 151,157 ****
  1376.   
  1377.   PUSHDIVERT(4)
  1378.   # resolve locally connected UUCP links
  1379. ! R$* < @ $=Z . UUCP. > $*    $#uucp-uudom $@ $1 $: $1 < @ $2 .UUCP. > $3    @host.UUCP: ...
  1380.   R$* < @ $=Y . UUCP. > $*    $#uucp-new $@ $2 $: $1 < @ $2 .UUCP. > $3
  1381.   R$* < @ $=U . UUCP. > $*    $#uucp-old $@ $2 $: $1 < @ $2 .UUCP. > $3
  1382.   POPDIVERT
  1383. --- 151,157 ----
  1384.   
  1385.   PUSHDIVERT(4)
  1386.   # resolve locally connected UUCP links
  1387. ! R$* < @ $=Z . UUCP. > $*    $#uucp-uudom $@ $2 $: $1 < @ $2 .UUCP. > $3
  1388.   R$* < @ $=Y . UUCP. > $*    $#uucp-new $@ $2 $: $1 < @ $2 .UUCP. > $3
  1389.   R$* < @ $=U . UUCP. > $*    $#uucp-old $@ $2 $: $1 < @ $2 .UUCP. > $3
  1390.   POPDIVERT
  1391. *** cf/ostype/bsd4.3.m4.OLD    Mon Jun  7 10:11:42 1993
  1392. --- cf/ostype/bsd4.3.m4    Thu Feb 10 09:03:27 1994
  1393. ***************
  1394. *** 34,38 ****
  1395.   #
  1396.   
  1397.   divert(0)
  1398. ! VERSIONID(`@(#)bsd4.3.m4    8.1 (Berkeley) 6/7/93')
  1399.   define(`QUEUE_DIR', /usr/spool/mqueue)dnl
  1400. --- 34,39 ----
  1401.   #
  1402.   
  1403.   divert(0)
  1404. ! VERSIONID(`@(#)bsd4.3.m4    8.2 (Berkeley) 2/10/94')
  1405.   define(`QUEUE_DIR', /usr/spool/mqueue)dnl
  1406. + define(`UUCP_MAILER_ARGS', `uux - -r -z -a$f $h!rmail ($u)')dnl
  1407. *** cf/ostype/bsd4.4.m4.OLD    Mon Jun  7 10:11:45 1993
  1408. --- cf/ostype/bsd4.4.m4    Thu Feb 10 09:03:27 1994
  1409. ***************
  1410. *** 35,41 ****
  1411.   #
  1412.   
  1413.   divert(0)
  1414. ! VERSIONID(`@(#)bsd4.4.m4    8.1 (Berkeley) 6/7/93')
  1415.   define(`HELP_FILE', /usr/share/misc/sendmail.hf)dnl
  1416.   define(`STATUS_FILE', /var/log/sendmail.st)dnl
  1417.   define(`LOCAL_MAILER_PATH', /usr/libexec/mail.local)dnl
  1418. --- 35,42 ----
  1419.   #
  1420.   
  1421.   divert(0)
  1422. ! VERSIONID(`@(#)bsd4.4.m4    8.2 (Berkeley) 2/10/94')
  1423.   define(`HELP_FILE', /usr/share/misc/sendmail.hf)dnl
  1424.   define(`STATUS_FILE', /var/log/sendmail.st)dnl
  1425.   define(`LOCAL_MAILER_PATH', /usr/libexec/mail.local)dnl
  1426. + define(`UUCP_MAILER_ARGS', `uux - -r -z -a$f $h!rmail ($u)')dnl
  1427. *** cf/ostype/domainos.m4.OLD    Sun Jan 23 16:47:31 1994
  1428. --- cf/ostype/domainos.m4    Sun Jan 23 16:47:23 1994
  1429. ***************
  1430. *** 0 ****
  1431. --- 1,42 ----
  1432. + divert(-1)
  1433. + #
  1434. + # Copyright (c) 1983 Eric P. Allman
  1435. + # Copyright (c) 1988, 1993
  1436. + #    The Regents of the University of California.  All rights reserved.
  1437. + #
  1438. + # Redistribution and use in source and binary forms, with or without
  1439. + # modification, are permitted provided that the following conditions
  1440. + # are met:
  1441. + # 1. Redistributions of source code must retain the above copyright
  1442. + #    notice, this list of conditions and the following disclaimer.
  1443. + # 2. Redistributions in binary form must reproduce the above copyright
  1444. + #    notice, this list of conditions and the following disclaimer in the
  1445. + #    documentation and/or other materials provided with the distribution.
  1446. + # 3. All advertising materials mentioning features or use of this software
  1447. + #    must display the following acknowledgement:
  1448. + #    This product includes software developed by the University of
  1449. + #    California, Berkeley and its contributors.
  1450. + # 4. Neither the name of the University nor the names of its contributors
  1451. + #    may be used to endorse or promote products derived from this software
  1452. + #    without specific prior written permission.
  1453. + #
  1454. + # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1455. + # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1456. + # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1457. + # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1458. + # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1459. + # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1460. + # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1461. + # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1462. + # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1463. + # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1464. + # SUCH DAMAGE.
  1465. + #
  1466. + divert(0)
  1467. + VERSIONID(`@(#)domainos.m4    8.1 (Berkeley) 1/23/94')
  1468. + divert(-1)
  1469. + define(`ALIAS_FILE', /usr/lib/aliases)
  1470. + define(`STATUS_FILE', /usr/lib/sendmail.st)
  1471. + define(`QUEUE_DIR', /usr/spool/mqueue)
  1472. *** cf/ostype/irix.m4.OLD    Sat Nov 27 09:29:26 1993
  1473. --- cf/ostype/irix.m4    Tue Feb  1 11:51:31 1994
  1474. ***************
  1475. *** 34,41 ****
  1476.   #
  1477.   
  1478.   divert(0)
  1479. ! VERSIONID(`@(#)irix.m4    8.3 (Berkeley) 11/27/93')
  1480. ! define(`LOCAL_MAILER_FLAGS', Ehmu)dnl
  1481.   define(`QUEUE_DIR', /usr/spool/mqueue)dnl
  1482.   define(`ALIAS_FILE', /usr/lib/aliases)dnl
  1483.   define(`STATUS_FILE', /usr/lib/sendmail.st)dnl
  1484. --- 34,41 ----
  1485.   #
  1486.   
  1487.   divert(0)
  1488. ! VERSIONID(`@(#)irix.m4    8.4 (Berkeley) 2/1/94')
  1489. ! define(`LOCAL_MAILER_FLAGS', Ehm)dnl
  1490.   define(`QUEUE_DIR', /usr/spool/mqueue)dnl
  1491.   define(`ALIAS_FILE', /usr/lib/aliases)dnl
  1492.   define(`STATUS_FILE', /usr/lib/sendmail.st)dnl
  1493. *** cf/ostype/solaris2.m4.OLD    Sat Aug  7 09:11:55 1993
  1494. --- cf/ostype/solaris2.m4    Sun Jan 23 16:48:06 1994
  1495. ***************
  1496. *** 34,43 ****
  1497.   #
  1498.   
  1499.   divert(0)
  1500. ! VERSIONID(`@(#)solaris2.m4    8.1 (Berkeley) 8/7/93')
  1501.   divert(-1)
  1502.   
  1503.   define(`ALIAS_FILE', /etc/mail/aliases)
  1504. ! define(`HELP_FILE', /var/lib/sendmail.hf)
  1505.   define(`STATUS_FILE', /etc/mail/sendmail.st)
  1506.   define(`LOCAL_MAILER_FLAGS', `fSn')
  1507. --- 34,43 ----
  1508.   #
  1509.   
  1510.   divert(0)
  1511. ! VERSIONID(`@(#)solaris2.m4    8.2 (Berkeley) 1/23/94')
  1512.   divert(-1)
  1513.   
  1514.   define(`ALIAS_FILE', /etc/mail/aliases)
  1515. ! define(`HELP_FILE', /etc/mail/sendmail.hf)
  1516.   define(`STATUS_FILE', /etc/mail/sendmail.st)
  1517.   define(`LOCAL_MAILER_FLAGS', `fSn')
  1518. *** cf/sh/makeinfo.sh.OLD    Fri Jul 23 14:55:52 1993
  1519. --- cf/sh/makeinfo.sh    Fri Mar  4 07:33:00 1994
  1520. ***************
  1521. *** 32,38 ****
  1522.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1523.   # SUCH DAMAGE.
  1524.   #
  1525. ! #    @(#)makeinfo.sh    8.3 (Berkeley) 7/23/93
  1526.   #
  1527.   
  1528.   usewhoami=0
  1529. --- 32,38 ----
  1530.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1531.   # SUCH DAMAGE.
  1532.   #
  1533. ! #    @(#)makeinfo.sh    8.4 (Berkeley) 3/4/94
  1534.   #
  1535.   
  1536.   usewhoami=0
  1537. ***************
  1538. *** 73,77 ****
  1539.   else
  1540.       host=`uname -n`
  1541.   fi
  1542. ! echo '#####' built by $user on `date`
  1543. ! echo '#####' in `pwd` on $host
  1544. --- 73,77 ----
  1545.   else
  1546.       host=`uname -n`
  1547.   fi
  1548. ! echo '#####' built by $user@$host on `date`
  1549. ! echo '#####' in `pwd` | sed 's/\/tmp_mnt//'
  1550. *** doc/intro/Makefile.OLD    Tue Jun  8 17:25:01 1993
  1551. --- doc/intro/Makefile    Mon Feb 28 10:18:07 1994
  1552. ***************
  1553. *** 1,4 ****
  1554. ! #    @(#)Makefile    8.1 (Berkeley) 6/8/93
  1555.   
  1556.   DIR=    smm/09.sendmail
  1557.   SRCS=    intro.me
  1558. --- 1,4 ----
  1559. ! #    @(#)Makefile    8.2 (Berkeley) 2/28/94
  1560.   
  1561.   DIR=    smm/09.sendmail
  1562.   SRCS=    intro.me
  1563. ***************
  1564. *** 7,12 ****
  1565. --- 7,13 ----
  1566.   all: intro.ps
  1567.   
  1568.   intro.ps: ${SRCS}
  1569. +     rm -f ${.TARGET}
  1570.       ${PIC} ${SRCS} | ${ROFF} > ${.TARGET}
  1571.   
  1572.   .include <bsd.doc.mk>
  1573. *** doc/op/Makefile.OLD    Tue Jun  8 17:24:19 1993
  1574. --- doc/op/Makefile    Mon Feb 28 10:17:05 1994
  1575. ***************
  1576. *** 1,4 ****
  1577. ! #    @(#)Makefile    8.1 (Berkeley) 6/8/93
  1578.   
  1579.   DIR=    smm/08.sendmailop
  1580.   SRCS=    op.me
  1581. --- 1,4 ----
  1582. ! #    @(#)Makefile    8.2 (Berkeley) 2/28/94
  1583.   
  1584.   DIR=    smm/08.sendmailop
  1585.   SRCS=    op.me
  1586. ***************
  1587. *** 7,12 ****
  1588. --- 7,13 ----
  1589.   all: op.ps
  1590.   
  1591.   op.ps: ${SRCS}
  1592. +     rm -f ${.TARGET}
  1593.       ${PIC} ${SRCS} | ${EQN} | ${ROFF} > ${.TARGET}
  1594.   
  1595.   .include <bsd.doc.mk>
  1596. *** doc/op/op.me.OLD    Wed Jan 12 06:52:00 1994
  1597. --- doc/op/op.me    Thu Mar  3 08:09:48 1994
  1598. ***************
  1599. *** 30,36 ****
  1600.   .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1601.   .\" SUCH DAMAGE.
  1602.   .\"
  1603. ! .\"    @(#)op.me    8.32 (Berkeley) 1/12/94
  1604.   .\"
  1605.   .\" eqn op.me | pic | troff -me
  1606.   .eh 'SMM:08-%''Sendmail Installation and Operation Guide'
  1607. --- 30,36 ----
  1608.   .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1609.   .\" SUCH DAMAGE.
  1610.   .\"
  1611. ! .\"    @(#)op.me    8.34 (Berkeley) 3/3/94
  1612.   .\"
  1613.   .\" eqn op.me | pic | troff -me
  1614.   .eh 'SMM:08-%''Sendmail Installation and Operation Guide'
  1615. ***************
  1616. *** 69,75 ****
  1617.   Mammoth Project
  1618.   eric@CS.Berkeley.EDU
  1619.   .sp
  1620. ! Version 8.32
  1621.   .sp
  1622.   For Sendmail Version 8.6
  1623.   .)l
  1624. --- 69,75 ----
  1625.   Mammoth Project
  1626.   eric@CS.Berkeley.EDU
  1627.   .sp
  1628. ! Version 8.34
  1629.   .sp
  1630.   For Sendmail Version 8.6
  1631.   .)l
  1632. ***************
  1633. *** 2471,2480 ****
  1634.   and assigned to the
  1635.   .b $u
  1636.   macro.
  1637.   .pp
  1638. ! Normally, a ruleset that matches is retried,
  1639.   that is,
  1640. ! the ruleset loops until it fails.
  1641.   A RHS may also be preceded by a
  1642.   .b $@
  1643.   or a
  1644. --- 2471,2492 ----
  1645.   and assigned to the
  1646.   .b $u
  1647.   macro.
  1648. + As a special case, if the value to
  1649. + .b $#
  1650. + is
  1651. + .q local
  1652. + and the first character of the
  1653. + .b $:
  1654. + value is
  1655. + .q @ ,
  1656. + the
  1657. + .q @
  1658. + is stripped off, and a flag is set in the address descriptor
  1659. + that causes sendmail to not do ruleset 5 processing.
  1660.   .pp
  1661. ! Normally, a rule that matches is retried,
  1662.   that is,
  1663. ! the rule loops until it fails.
  1664.   A RHS may also be preceded by a
  1665.   .b $@
  1666.   or a
  1667. ***************
  1668. *** 3387,3393 ****
  1669.   This is the default if the
  1670.   .b L
  1671.   flag is set.
  1672. ! Note that setting this is not
  1673.   sufficient to get full eight bit data passed through
  1674.   .i sendmail .
  1675.   If the
  1676. --- 3399,3405 ----
  1677.   This is the default if the
  1678.   .b L
  1679.   flag is set.
  1680. ! Note that clearing this option is not
  1681.   sufficient to get full eight bit data passed through
  1682.   .i sendmail .
  1683.   If the
  1684. ***************
  1685. *** 6875,6881 ****
  1686.   .\"Eric Allman
  1687.   .\"Britton-Lee, Inc.
  1688.   .\".sp
  1689. ! .\"Version 8.32
  1690.   .\".ce 0
  1691.   .bp 2
  1692.   .rs
  1693. --- 6887,6893 ----
  1694.   .\"Eric Allman
  1695.   .\"Britton-Lee, Inc.
  1696.   .\".sp
  1697. ! .\"Version 8.34
  1698.   .\".ce 0
  1699.   .bp 2
  1700.   .rs
  1701. *** doc/usenix/Makefile.OLD    Mon Jun  7 10:18:10 1993
  1702. --- doc/usenix/Makefile    Mon Feb 28 10:17:36 1994
  1703. ***************
  1704. *** 1,4 ****
  1705. ! #    @(#)Makefile    8.1 (Berkeley) 6/7/93
  1706.   
  1707.   SRCS=    usenix.me
  1708.   MACROS=    -me
  1709. --- 1,4 ----
  1710. ! #    @(#)Makefile    8.2 (Berkeley) 2/28/94
  1711.   
  1712.   SRCS=    usenix.me
  1713.   MACROS=    -me
  1714. ***************
  1715. *** 6,11 ****
  1716. --- 6,12 ----
  1717.   all: usenix.ps
  1718.   
  1719.   usenix.ps: ${SRCS}
  1720. +     rm -f ${.TARGET}
  1721.       ${PIC} ${SRCS} | ${ROFF} > ${.TARGET}
  1722.   
  1723.   .include <bsd.doc.mk>
  1724. *** praliases/praliases.c.OLD    Wed Sep 22 10:55:40 1993
  1725. --- praliases/praliases.c    Sun Mar  6 08:59:32 1994
  1726. ***************
  1727. *** 39,45 ****
  1728.   #endif /* not lint */
  1729.   
  1730.   #ifndef lint
  1731. ! static char sccsid[] = "@(#)praliases.c    8.2 (Berkeley) 9/22/93";
  1732.   #endif /* not lint */
  1733.   
  1734.   #include <ndbm.h>
  1735. --- 39,45 ----
  1736.   #endif /* not lint */
  1737.   
  1738.   #ifndef lint
  1739. ! static char sccsid[] = "@(#)praliases.c    8.3 (Berkeley) 3/6/94";
  1740.   #endif /* not lint */
  1741.   
  1742.   #include <ndbm.h>
  1743. ***************
  1744. *** 85,99 ****
  1745.       if (db = dbopen(buf, O_RDONLY, 0444 , DB_HASH, NULL)) {
  1746.           if (!argc) {
  1747.               while(!db->seq(db, &newdbkey, &newdbcontent, R_NEXT))
  1748. !                 printf("%s:%s\n", newdbkey.data,
  1749. !                         newdbcontent.data);
  1750.           }
  1751.           else for (; *argv; ++argv) {
  1752.               newdbkey.data = *argv;
  1753.               newdbkey.size = strlen(*argv) + 1;
  1754. !             if ( !db->get(db, &newdbkey, &newdbcontent, 0) )
  1755. !                 printf("%s:%s\n", newdbkey.data,
  1756. !                     newdbcontent.data);
  1757.               else
  1758.                   printf("%s: No such key\n",
  1759.                       newdbkey.data);
  1760. --- 85,100 ----
  1761.       if (db = dbopen(buf, O_RDONLY, 0444 , DB_HASH, NULL)) {
  1762.           if (!argc) {
  1763.               while(!db->seq(db, &newdbkey, &newdbcontent, R_NEXT))
  1764. !                 printf("%.*s:%.*s\n",
  1765. !                     newdbkey.size, newdbkey.data,
  1766. !                     newdbcontent.size, newdbcontent.data);
  1767.           }
  1768.           else for (; *argv; ++argv) {
  1769.               newdbkey.data = *argv;
  1770.               newdbkey.size = strlen(*argv) + 1;
  1771. !             if (!db->get(db, &newdbkey, &newdbcontent, 0))
  1772. !                 printf("%s:%.*s\n", newdbkey.data,
  1773. !                     newdbcontent.size, newdbcontent.data);
  1774.               else
  1775.                   printf("%s: No such key\n",
  1776.                       newdbkey.data);
  1777. ***************
  1778. *** 110,116 ****
  1779.               for (key = dbm_firstkey(dbp);
  1780.                   key.dptr != NULL; key = dbm_nextkey(dbp)) {
  1781.                   content = dbm_fetch(dbp, key);
  1782. !                 (void)printf("%s:%s\n", key.dptr, content.dptr);
  1783.               }
  1784.           else for (; *argv; ++argv) {
  1785.               key.dptr = *argv;
  1786. --- 111,119 ----
  1787.               for (key = dbm_firstkey(dbp);
  1788.                   key.dptr != NULL; key = dbm_nextkey(dbp)) {
  1789.                   content = dbm_fetch(dbp, key);
  1790. !                 (void)printf("%.*s:%.*s\n",
  1791. !                     key.dsize, key.dptr,
  1792. !                     content.dsize, content.dptr);
  1793.               }
  1794.           else for (; *argv; ++argv) {
  1795.               key.dptr = *argv;
  1796. ***************
  1797. *** 119,125 ****
  1798.               if (!content.dptr)
  1799.                   (void)printf("%s: No such key\n", key.dptr);
  1800.               else
  1801. !                 (void)printf("%s:%s\n", key.dptr, content.dptr);
  1802.           }
  1803.   #ifdef NEWDB
  1804.       }
  1805. --- 122,129 ----
  1806.               if (!content.dptr)
  1807.                   (void)printf("%s: No such key\n", key.dptr);
  1808.               else
  1809. !                 (void)printf("%s:%.*s\n", key.dptr,
  1810. !                     content.dsize, content.dptr);
  1811.           }
  1812.   #ifdef NEWDB
  1813.       }
  1814. *** src/Makefile.OLD    Mon Dec 20 10:52:10 1993
  1815. --- src/Makefile    Sat Mar  5 11:51:53 1994
  1816. ***************
  1817. *** 1,4 ****
  1818. ! #    @(#)Makefile    8.3 (Berkeley) 12/20/93
  1819.   
  1820.   PROG=    sendmail
  1821.   
  1822. --- 1,4 ----
  1823. ! #    @(#)Makefile    8.4 (Berkeley) 2/3/94
  1824.   
  1825.   PROG=    sendmail
  1826.   
  1827. ***************
  1828. *** 21,27 ****
  1829.       util.c version.c
  1830.   DPADD=    
  1831.   LDADD=    
  1832. ! MAN1=    newaliases.0
  1833.   MAN5=    aliases.0
  1834.   MAN8=    sendmail.0 
  1835.   LINKS=    /usr/sbin/sendmail /usr/bin/newaliases \
  1836. --- 21,27 ----
  1837.       util.c version.c
  1838.   DPADD=    
  1839.   LDADD=    
  1840. ! MAN1=    mailq.0 newaliases.0
  1841.   MAN5=    aliases.0
  1842.   MAN8=    sendmail.0 
  1843.   LINKS=    /usr/sbin/sendmail /usr/bin/newaliases \
  1844. *** src/Makefile.BSD43.OLD    Wed Feb  2 05:51:28 1994
  1845. --- src/Makefile.BSD43    Sat Mar  5 11:50:24 1994
  1846. ***************
  1847. *** 8,13 ****
  1848. --- 8,18 ----
  1849.   #    This is based on work from Jim Oldroyd -- I believe he was
  1850.   #    using a fairly old Mt Xinu port.
  1851.   #
  1852. + #    It should also work on UMIPS-BSD from MIPS, if you still have
  1853. + #    any lying around.
  1854. + #
  1855. + #    @(#)Makefile.BSD43    8.2 (Berkeley) 3/5/94
  1856. + #
  1857.   
  1858.   # use O=-O (usual) or O=-g (debugging)
  1859.   O=    -O
  1860. ***************
  1861. *** 65,71 ****
  1862.   BINGRP=    kmem
  1863.   BINMODE=6555
  1864.   
  1865. ! ALL=    sendmail aliases.0 newaliases.0 sendmail.0
  1866.   
  1867.   all: ${ALL}
  1868.   
  1869. --- 70,76 ----
  1870.   BINGRP=    kmem
  1871.   BINMODE=6555
  1872.   
  1873. ! ALL=    sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
  1874.   
  1875.   all: ${ALL}
  1876.   
  1877. ***************
  1878. *** 87,92 ****
  1879. --- 92,100 ----
  1880.   aliases.0: aliases.5
  1881.       nroff -h -mandoc aliases.5 > aliases.0
  1882.   
  1883. + mailq.0: mailq.1
  1884. +     nroff -h -mandoc mailq.1 > mailq.0
  1885.   newaliases.0: newaliases.1
  1886.       nroff -h -mandoc newaliases.1 > newaliases.0
  1887.   
  1888. ***************
  1889. *** 103,112 ****
  1890.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  1891.   
  1892.   # doesn't actually install them -- you may want to install pre-nroff versions
  1893. ! install-docs: aliases.0 newaliases.0 sendmail.0
  1894.   
  1895.   clean:
  1896. !     rm -f ${OBJS} sendmail aliases.0 newaliases.0 sendmail.0
  1897.   
  1898.   # dependencies
  1899.   #   gross overkill, and yet still not quite enough....
  1900. --- 111,120 ----
  1901.       install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  1902.   
  1903.   # doesn't actually install them -- you may want to install pre-nroff versions
  1904. ! install-docs: aliases.0 mailq.0 newaliases.0 sendmail.0
  1905.   
  1906.   clean:
  1907. !     rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
  1908.   
  1909.   # dependencies
  1910.   #   gross overkill, and yet still not quite enough....
  1911. *** src/Makefile.BSDI.OLD    Thu Feb  3 08:52:53 1994
  1912. --- src/Makefile.BSDI    Sat Mar  5 11:51:53 1994
  1913. ***************
  1914. *** 1,97 ****
  1915. ! #
  1916. ! #  This Makefile is designed to work on the old "make" program.  It does
  1917. ! #  not use the obj subdirectory.  It also does not install documentation
  1918. ! #  automatically -- think of it as a quick start for sites that have the
  1919. ! #  old make program (I recommend that you get and port the new make if you
  1920. ! #  are going to be doing any signficant work on sendmail).
  1921. ! #
  1922. ! #  This has been tested on BSDI's BSD/386 release 1.0.
  1923. ! #
  1924.   
  1925. ! # use O=-O (usual) or O=-g (debugging)
  1926. ! O=    -O
  1927.   
  1928. ! # define the database mechanisms available for map & alias lookups:
  1929. ! #    -DNDBM -- use new DBM
  1930. ! #    -DNEWDB -- use new Berkeley DB
  1931. ! #    -DNIS -- include NIS support
  1932. ! # The really old (V7) DBM library is no longer supported.
  1933. ! # See READ_ME for a description of how these flags interact.
  1934. ! #
  1935. ! DBMDEF=    -DNDBM -DNEWDB -DOLD_NEWDB
  1936. ! # environment definitions (e.g., -D_AIX3)
  1937. ! ENVDEF= -DLA_TYPE=LA_SUBR
  1938. ! # see also conf.h for additional compilation flags
  1939. ! # include directories
  1940. ! #INCDIRS=-I/usr/sww/include/db
  1941. ! # library directories
  1942. ! #LIBDIRS=-L/usr/sww/lib
  1943. ! # libraries required on your system
  1944. ! LIBS=    -lutil -lkvm
  1945. ! # location of sendmail binary (usually /usr/sbin or /usr/lib)
  1946. ! BINDIR=    ${DESTDIR}/usr/sbin
  1947. ! # location of sendmail.st file (usually /var/log or /usr/lib)
  1948. ! STDIR=    ${DESTDIR}/var/log
  1949. ! # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  1950. ! HFDIR=    ${DESTDIR}/usr/share/misc
  1951. ! # additional .o files needed
  1952. ! OBJADD=
  1953. ! ###################  end of user configuration flags  ######################
  1954. ! CFLAGS=    -I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
  1955. ! OBJS=    alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  1956. !     deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  1957. !     map.o mci.o parseaddr.o queue.o readcf.o recipient.o \
  1958. !     savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  1959. !     trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  1960. ! LINKS=    ${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq
  1961.   BINOWN=    root
  1962.   BINGRP=    kmem
  1963.   BINMODE=6555
  1964.   
  1965. ! ALL=    sendmail aliases.0 newaliases.0 sendmail.0
  1966. ! all: ${ALL}
  1967. ! sendmail: ${BEFORE} ${OBJS}
  1968. !     ${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
  1969. ! aliases.0: aliases.5
  1970. !     nroff -mandoc aliases.5 > aliases.0
  1971. ! newaliases.0: newaliases.1
  1972. !     nroff -mandoc newaliases.1 > newaliases.0
  1973. ! sendmail.0: sendmail.8
  1974. !     nroff -mandoc sendmail.8 > sendmail.0
  1975. ! install: install-sendmail install-docs
  1976. ! install-sendmail: sendmail
  1977. !     install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  1978. !     for i in ${LINKS}; do (rm -f $$i; ln -s ${BINDIR}/sendmail $$i); done
  1979.       install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  1980. !         ${STDIR}/sendmail.st
  1981. !     install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  1982.   
  1983. ! # doesn't actually install them -- you may want to install pre-nroff versions
  1984. ! install-docs: aliases.0 newaliases.0 sendmail.0
  1985. ! clean:
  1986. !     rm -f ${OBJS} sendmail aliases.0 newaliases.0 sendmail.0
  1987. ! # dependencies
  1988. ! #   gross overkill, and yet still not quite enough....
  1989. ! ${OBJS}: sendmail.h conf.h
  1990. --- 1,32 ----
  1991. ! #    @(#)Makefile.BSDI    8.1 (Berkeley) 2/26/94
  1992.   
  1993. ! PROG=    sendmail
  1994. ! DBMDEF=    -DNEWDB
  1995. ! CFLAGS+=-I${.CURDIR} ${DBMDEF} -DNETISO
  1996.   
  1997. ! SRCS=    alias.c arpadate.c clock.c collect.c conf.c convtime.c daemon.c \
  1998. !     deliver.c domain.c envelope.c err.c headers.c macro.c main.c map.c \
  1999. !     mci.c parseaddr.c queue.c readcf.c recipient.c savemail.c srvrsmtp.c \
  2000. !     stab.c stats.c sysexits.c trace.c udb.c usersmtp.c \
  2001. !     util.c version.c
  2002. ! DPADD=    ${LIBUTIL} ${LIBKVM}
  2003. ! LDADD=    -lutil -lkvm
  2004. ! MAN1=    mailq.0 newaliases.0
  2005. ! MAN5=    aliases.0
  2006. ! MAN8=    sendmail.0 
  2007. ! LINKS=    /usr/sbin/sendmail /usr/bin/newaliases \
  2008. !     /usr/sbin/sendmail /usr/bin/mailq
  2009. ! BINDIR=    /usr/sbin
  2010.   BINOWN=    root
  2011.   BINGRP=    kmem
  2012.   BINMODE=6555
  2013.   
  2014. ! beforeinstall:
  2015. ! #    install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  2016. ! #        ${DESTDIR}/etc/sendmail.fc
  2017.       install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  2018. !         ${DESTDIR}/var/log/sendmail.st
  2019. !     install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/sendmail.hf \
  2020. !         ${DESTDIR}/usr/share/misc
  2021.   
  2022. ! .include <bsd.prog.mk>
  2023. *** src/Makefile.DomainOS.OLD    Sat Jan 22 07:36:32 1994
  2024. --- src/Makefile.DomainOS    Tue Mar  8 10:00:08 1994
  2025. ***************
  2026. *** 0 ****
  2027. --- 1,121 ----
  2028. + #
  2029. + #  This Makefile is designed to work on the old "make" program.  It does
  2030. + #  not use the obj subdirectory.  It also does not install documentation
  2031. + #  automatically -- think of it as a quick start for sites that have the
  2032. + #  old make program (I recommend that you get and port the new make if you
  2033. + #  are going to be doing any signficant work on sendmail).
  2034. + #
  2035. + #  This has been tested on DomainOS 10.3.5
  2036. + #
  2037. + #    @(#)Makefile.DomainOS    8.3 (Berkeley) 3/8/94
  2038. + #
  2039. + #
  2040. + # use O=-O (usual) or O=-g (debugging)
  2041. + O=    -O
  2042. + # define the database mechanisms available for map & alias lookups:
  2043. + #    -DNDBM -- use new DBM
  2044. + #    -DNEWDB -- use new Berkeley DB
  2045. + #    -DNDBM -DNEWDB -DYPCOMPAT -- use both plus YP compatility
  2046. + #    -DNIS -- include client NIS support
  2047. + # The really old (V7) DBM library is no longer supported.
  2048. + # If YPCOMPAT is defined and /var/yp/Makefile exists, sendmail will build
  2049. + #   both the NEWDB and DBM libraries (the DBM just for YP).
  2050. + #
  2051. + DBMDEF=    -DNDBM
  2052. + # environment definitions (e.g., -D_AIX3)
  2053. + ENVDEF=
  2054. + # see also conf.h for additional compilation flags
  2055. + # include directories
  2056. + INCDIRS=
  2057. + # loader options
  2058. + LDOPTS=
  2059. + # library directories
  2060. + LIBDIRS=
  2061. + # libraries required on your system
  2062. + # You might want to use the BIND 4.9 resolver library here
  2063. + #LIBS=    -ldb -ldbm
  2064. + LIBS=    -ldbm -lresolv
  2065. + # location of sendmail binary (usually /usr/sbin or /usr/lib)
  2066. + BINDIR=    ${DESTDIR}/usr/lib
  2067. + # location of sendmail.st file (usually /var/log or /usr/lib)
  2068. + STDIR=    ${DESTDIR}/usr/adm
  2069. + # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  2070. + HFDIR=    ${DESTDIR}/usr/lib
  2071. + # additional .o files needed
  2072. + OBJADD=
  2073. + # additional pseudo-sources needed
  2074. + BEFORE=    unistd.h dirent.h
  2075. + ###################  end of user configuration flags  ######################
  2076. + CFLAGS=    -I. -A nansi $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
  2077. + OBJS=    alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  2078. +     deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  2079. +     map.o mci.o parseaddr.o queue.o readcf.o recipient.o \
  2080. +     savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  2081. +     trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  2082. + LINKS=    ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
  2083. + BINOWN=    root
  2084. + BINGRP=    kmem
  2085. + BINMODE=6555
  2086. + ALL=    sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
  2087. + all: ${ALL}
  2088. + sendmail: ${BEFORE} ${OBJS}
  2089. +     ${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
  2090. + unistd.h:
  2091. +     cp /dev/null unistd.h
  2092. + dirent.h:
  2093. +     echo "#include <sys/dir.h>" > dirent.h
  2094. +     echo "#define dirent    direct" >> dirent.h
  2095. + aliases.0: aliases.5
  2096. +     nroff -h -mandoc aliases.5 > aliases.0
  2097. + mailq.0: mailq.1
  2098. +     nroff -h -mandoc mailq.1 > mailq.0
  2099. + newaliases.0: newaliases.1
  2100. +     nroff -h -mandoc newaliases.1 > newaliases.0
  2101. + sendmail.0: sendmail.8
  2102. +     nroff -h -mandoc sendmail.8 > sendmail.0
  2103. + install: install-sendmail install-docs
  2104. + install-sendmail: sendmail
  2105. +     install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  2106. +     for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  2107. +     install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  2108. +         ${STDIR}/sendmail.st
  2109. +     install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  2110. + # doesn't actually install them -- you may want to install pre-nroff versions
  2111. + install-docs: aliases.0 mailq.0 newaliases.0 sendmail.0
  2112. + clean:
  2113. +     rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
  2114. + # dependencies
  2115. + #   gross overkill, and yet still not quite enough....
  2116. + ${OBJS}: sendmail.h conf.h
  2117. *** src/Makefile.NetBSD.OLD    Mon Jan 10 07:29:03 1994
  2118. --- src/Makefile.NetBSD    Sat Mar  5 11:51:53 1994
  2119. ***************
  2120. *** 1,9 ****
  2121.   #
  2122.   #  NetBSD Makefile
  2123.   #
  2124.   
  2125. - #    @(#)Makefile    8.2 (Berkeley) 8/15/93
  2126.   PROG=    sendmail
  2127.   
  2128.   # define the database format to use for aliases et al.  Can be -DNEWDB (for
  2129. --- 1,10 ----
  2130.   #
  2131.   #  NetBSD Makefile
  2132.   #
  2133. + #    @(#)Makefile.NetBSD    8.1 (Berkeley) 2/26/94
  2134. + #    @Id: Makefile.NetBSD,v 1.3 1994/02/01 05:33:44 glass Exp $
  2135. + #
  2136.   
  2137.   PROG=    sendmail
  2138.   
  2139.   # define the database format to use for aliases et al.  Can be -DNEWDB (for
  2140. ***************
  2141. *** 14,20 ****
  2142.   # databases are read, but the new format will be used on any rebuilds.  On
  2143.   # really gnarly systems, you can set this to null; it will crawl like a high
  2144.   # spiral snail, but it will work.
  2145. ! DBMDEF=    -DNEWDB -DNDBM
  2146.   
  2147.   #nasty warning about gcc 2.4.x caused bugs 
  2148.   CFLAGS=-I${.CURDIR} ${DBMDEF} -DNETISO
  2149. --- 15,21 ----
  2150.   # databases are read, but the new format will be used on any rebuilds.  On
  2151.   # really gnarly systems, you can set this to null; it will crawl like a high
  2152.   # spiral snail, but it will work.
  2153. ! DBMDEF=    -DNEWDB -DNIS
  2154.   
  2155.   #nasty warning about gcc 2.4.x caused bugs 
  2156.   CFLAGS=-I${.CURDIR} ${DBMDEF} -DNETISO
  2157. ***************
  2158. *** 25,33 ****
  2159.       mci.c parseaddr.c queue.c readcf.c recipient.c savemail.c srvrsmtp.c \
  2160.       stab.c stats.c sysexits.c trace.c udb.c usersmtp.c \
  2161.       util.c version.c
  2162. ! DPADD=    $(LIBUTIL)
  2163. ! LDADD=    -lutil
  2164. ! MAN1=    newaliases.0
  2165.   MAN5=    aliases.0
  2166.   MAN8=    sendmail.0 
  2167.   LINKS=    /usr/sbin/sendmail /usr/bin/newaliases \
  2168. --- 26,32 ----
  2169.       mci.c parseaddr.c queue.c readcf.c recipient.c savemail.c srvrsmtp.c \
  2170.       stab.c stats.c sysexits.c trace.c udb.c usersmtp.c \
  2171.       util.c version.c
  2172. ! MAN1=    mailq.0 newaliases.0
  2173.   MAN5=    aliases.0
  2174.   MAN8=    sendmail.0 
  2175.   LINKS=    /usr/sbin/sendmail /usr/bin/newaliases \
  2176. ***************
  2177. *** 34,41 ****
  2178.       /usr/sbin/sendmail /usr/bin/mailq
  2179.   BINDIR=    /usr/sbin
  2180.   BINOWN=    root
  2181. ! BINGRP=    kmem
  2182. ! BINMODE=6555
  2183.   
  2184.   beforeinstall:
  2185.   #    install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  2186. --- 33,39 ----
  2187.       /usr/sbin/sendmail /usr/bin/mailq
  2188.   BINDIR=    /usr/sbin
  2189.   BINOWN=    root
  2190. ! BINMODE=4555
  2191.   
  2192.   beforeinstall:
  2193.   #    install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  2194. *** src/Makefile.PTX.OLD    Wed Feb  9 09:42:29 1994
  2195. --- src/Makefile.PTX    Sat Mar  5 11:50:26 1994
  2196. ***************
  2197. *** 0 ****
  2198. --- 1,109 ----
  2199. + #
  2200. + #  This Makefile is designed to work on the old "make" program.  It does
  2201. + #  not use the obj subdirectory.  It also does not install documentation
  2202. + #  automatically -- think of it as a quick start for sites that have the
  2203. + #  old make program (I recommend that you get and port the new make if you
  2204. + #  are going to be doing any signficant work on sendmail).
  2205. + #
  2206. + #    For Sequent DYNIX/ptx.
  2207. + #
  2208. + #    From Tim "Pinball Wizard" Wright <timw@sequent.com>.
  2209. + #
  2210. + #    @(#)Makefile.PTX    8.2 (Berkeley) 3/5/94
  2211. + #
  2212. + # use O=-O (usual) or O=-g (debugging)
  2213. + O=    -g
  2214. + # define the database mechanisms available for map & alias lookups:
  2215. + #    -DNDBM -- use new DBM
  2216. + #    -DNEWDB -- use new Berkeley DB
  2217. + #    -DNIS -- include NIS support
  2218. + # The really old (V7) DBM library is no longer supported.
  2219. + # See READ_ME for a description of how these flags interact.
  2220. + #
  2221. + DBMDEF=    -DNDBM
  2222. + # environment definitions (e.g., -D_AIX3)
  2223. + ENVDEF=
  2224. + # see also conf.h for additional compilation flags
  2225. + # include directories
  2226. + #INCDIRS=-I/usr/sww/include/db
  2227. + INCDIRS=
  2228. + # loader options
  2229. + LDOPTS=
  2230. + # library directories
  2231. + #LIBDIRS=-L/usr/sww/lib
  2232. + LIBDIRS=
  2233. + # libraries required on your system
  2234. + #LIBS=    -ldb -ldbm
  2235. + LIBS=    -lsocket -linet -lnsl -lseq
  2236. + # location of sendmail binary (usually /usr/sbin or /usr/lib)
  2237. + BINDIR=    ${DESTDIR}/usr/lib
  2238. + # location of sendmail.st file (usually /var/log or /usr/lib)
  2239. + STDIR=    ${DESTDIR}/usr/lib
  2240. + # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
  2241. + HFDIR=    ${DESTDIR}/usr/lib
  2242. + # additional .o files needed
  2243. + OBJADD=
  2244. + ###################  end of user configuration flags  ######################
  2245. + CFLAGS=    -I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
  2246. + OBJS=    alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
  2247. +     deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
  2248. +     map.o mci.o parseaddr.o queue.o readcf.o recipient.o \
  2249. +     savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
  2250. +     trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
  2251. + LINKS=    ${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq
  2252. + BINOWN=    root
  2253. + BINGRP=    sys
  2254. + BINMODE=6555
  2255. + ALL=    sendmail aliases.0 newaliases.0 sendmail.0
  2256. + all: ${ALL}
  2257. + sendmail: $& ${BEFORE} ${OBJS}
  2258. +     ${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
  2259. + aliases.0: aliases.5
  2260. +     nroff -h -mandoc aliases.5 > aliases.0
  2261. + newaliases.0: newaliases.1
  2262. +     nroff -h -mandoc newaliases.1 > newaliases.0
  2263. + sendmail.0: sendmail.8
  2264. +     nroff -h -mandoc sendmail.8 > sendmail.0
  2265. + INSTALL=install
  2266. + install: install-sendmail install-docs
  2267. + install-sendmail: sendmail
  2268. +     ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  2269. +     for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  2270. +     ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
  2271. +         ${STDIR}/sendmail.st
  2272. +     ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  2273. + # doesn't actually install them -- you may want to install pre-nroff versions
  2274. + install-docs: aliases.0 mailq.0 newaliases.0 sendmail.0
  2275. + clean:
  2276. +     rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
  2277. + # dependencies
  2278. + #   gross overkill, and yet still not quite enough....
  2279. + ${OBJS}: sendmail.h conf.h
  2280. *** src/Makefile.dist.OLD    Mon Dec 20 10:52:10 1993
  2281. --- src/Makefile.dist    Sat Mar  5 11:50:24 1994
  2282. ***************
  2283. *** 5,11 ****
  2284.   #  old make program (I recommend that you get and port the new make if you
  2285.   #  are going to be doing any signficant work on sendmail).
  2286.   #
  2287. ! #    @(#)Makefile.dist    8.9 (Berkeley) 12/20/93
  2288.   #
  2289.   
  2290.   # use O=-O (usual) or O=-g (debugging)
  2291. --- 5,11 ----
  2292.   #  old make program (I recommend that you get and port the new make if you
  2293.   #  are going to be doing any signficant work on sendmail).
  2294.   #
  2295. ! #    @(#)Makefile.dist    8.11 (Berkeley) 3/5/94
  2296.   #
  2297.   
  2298.   # use O=-O (usual) or O=-g (debugging)
  2299. ***************
  2300. *** 64,70 ****
  2301.   BINGRP=    kmem
  2302.   BINMODE=6555
  2303.   
  2304. ! ALL=    sendmail aliases.0 newaliases.0 sendmail.0
  2305.   
  2306.   all: ${ALL}
  2307.   
  2308. --- 64,70 ----
  2309.   BINGRP=    kmem
  2310.   BINMODE=6555
  2311.   
  2312. ! ALL=    sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
  2313.   
  2314.   all: ${ALL}
  2315.   
  2316. ***************
  2317. *** 74,79 ****
  2318. --- 74,82 ----
  2319.   aliases.0: aliases.5
  2320.       nroff -h -mandoc aliases.5 > aliases.0
  2321.   
  2322. + mailq.0: mailq.1
  2323. +     nroff -h -mandoc mailq.1 > mailq.0
  2324.   newaliases.0: newaliases.1
  2325.       nroff -h -mandoc newaliases.1 > newaliases.0
  2326.   
  2327. ***************
  2328. *** 92,101 ****
  2329.       ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  2330.   
  2331.   # doesn't actually install them -- you may want to install pre-nroff versions
  2332. ! install-docs: aliases.0 newaliases.0 sendmail.0
  2333.   
  2334.   clean:
  2335. !     rm -f ${OBJS} sendmail aliases.0 newaliases.0 sendmail.0
  2336.   
  2337.   # dependencies
  2338.   #   gross overkill, and yet still not quite enough....
  2339. --- 95,104 ----
  2340.       ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  2341.   
  2342.   # doesn't actually install them -- you may want to install pre-nroff versions
  2343. ! install-docs: aliases.0 mailq.0 newaliases.0 sendmail.0
  2344.   
  2345.   clean:
  2346. !     rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
  2347.   
  2348.   # dependencies
  2349.   #   gross overkill, and yet still not quite enough....
  2350. *** src/READ_ME.OLD    Wed Jan 12 06:00:15 1994
  2351. --- src/READ_ME    Sun Mar 13 09:38:25 1994
  2352. ***************
  2353. *** 30,36 ****
  2354.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  2355.   # SUCH DAMAGE.
  2356.   #
  2357. ! #    @(#)READ_ME    8.47 (Berkeley) 1/12/94
  2358.   #
  2359.   
  2360.   This directory contains the source files for sendmail.
  2361. --- 30,36 ----
  2362.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  2363.   # SUCH DAMAGE.
  2364.   #
  2365. ! #    @(#)READ_ME    8.58 (Berkeley) 3/13/94
  2366.   #
  2367.   
  2368.   This directory contains the source files for sendmail.
  2369. ***************
  2370. *** 138,143 ****
  2371. --- 138,149 ----
  2372.   BSD/386 or 386BSD-based systems, use the one that already exists
  2373.   on your system.  You may need to define OLD_NEWDB to do this.]
  2374.   
  2375. + [NOTE WELL: it is CRITICAL that you remove ndbm.o from libdb.a and
  2376. + ndbm.h from the appropriate include directories if you want to get
  2377. + ndbm support.  These files OVERRIDE calls to ndbm routines -- in
  2378. + particular, if you leave ndbm.h in, you can find yourself using
  2379. + the new db package even if you don't define NEWDB.]
  2380.   If NEWDB and NDBM are defined (but not NIS), then sendmail will read
  2381.   NDBM format alias files, but the next time a newaliases is run the
  2382.   format will be converted to NEWDB; that format will be used forever
  2383. ***************
  2384. *** 179,184 ****
  2385. --- 185,191 ----
  2386.           have to make -- see below.
  2387.   _AIX3        Define this if you are IBM AIX 3.x.
  2388.   RISCOS        Define this if you are running RISC/os from MIPS.
  2389. + IRIX        Define this if you are running IRIX from SGI.
  2390.   _SCO_unix_    Define this if you are on SCO UNIX.
  2391.   _SCO_unix_4_2    Define this if you are on SCO Open Server 3.2v4.
  2392.   
  2393. ***************
  2394. *** 204,215 ****
  2395.           SYSTEM5.
  2396.   HASUNSETENV    Define this if your system library has the "unsetenv"
  2397.           subroutine.
  2398. - HASSTATFS    Define this if you have the statfs(2) system call.  It's
  2399. -         not a disaster to get this wrong -- but you do lose the
  2400. -         queue free space code.
  2401. - HASUSTAT    Define this if you have the ustat(2) system call.  It's
  2402. -         not a disaster to get this wrong -- but you do lose the
  2403. -         queue free space code.
  2404.   HASSETSID    Define this if you have the setsid(2) system call.  This
  2405.           is implied if your system appears to be POSIX compliant.
  2406.   HASINITGROUPS    Define this if you have the initgroups(3) routine.
  2407. --- 211,216 ----
  2408. ***************
  2409. *** 270,288 ****
  2410.           If you are an very old compiler you may need to define
  2411.           this to be "char *".
  2412.   LA_TYPE        The type of load average your kernel supports.  These
  2413. !         can be LA_SUBR (4) if you have the getloadavg(3) routine,
  2414.           LA_MACH (5) to use MACH-style load averages (calls
  2415. !         processor_set_info()), LA_FLOAT (3) if you read kmem and
  2416. !         interpret the value as a floating point number, LA_INT (2)
  2417. !         to interpret as a long integer, or LA_SHORT (6) to
  2418. !         interpret as a short integer.  These last three have
  2419. !         several other parameters that they try to divine: the
  2420. !         name of your kernel, the name of the variable in the
  2421. !         kernel to examine, the number of bits of precision in
  2422. !         a fixed point load average, and so forth.  In desparation,
  2423. !         use LA_ZERO (1) -- it always returns the load average as
  2424. !         "zero" (and does so on all architectures).  The actual
  2425. !         code is in conf.c -- it can be tweaked if you are brave.
  2426.   ERRLIST_PREDEFINED
  2427.           If set, assumes that some header file defines sys_errlist.
  2428.           This may be needed if you get type conflicts on this
  2429. --- 271,306 ----
  2430.           If you are an very old compiler you may need to define
  2431.           this to be "char *".
  2432.   LA_TYPE        The type of load average your kernel supports.  These
  2433. !         can be one of:
  2434. !         LA_ZERO (1) -- it always returns the load average as
  2435. !             "zero" (and does so on all architectures).
  2436. !         LA_SUBR (4) if you have the getloadavg(3) routine,
  2437.           LA_MACH (5) to use MACH-style load averages (calls
  2438. !             processor_set_info()),
  2439. !         LA_PROCSTR (7) to read /proc/loadavg and interpret it
  2440. !             as a string representing a floating-point
  2441. !             number (Linux-style),
  2442. !         LA_FLOAT (3) if you read kmem and interpret the value
  2443. !             as a floating point number,
  2444. !         LA_INT (2) to interpret as a long integer,
  2445. !         LA_SHORT (6) to interpret as a short integer.
  2446. !         These last three have several other parameters that they
  2447. !         try to divine: the name of your kernel, the name of the
  2448. !         variable in the kernel to examine, the number of bits of
  2449. !         precision in a fixed point load average, and so forth.
  2450. !         In desperation, use LA_ZERO.  The actual code is in
  2451. !         conf.c -- it can be tweaked if you are brave.
  2452. ! SFS_TYPE    Encodes how your kernel can locate the amount of free
  2453. !         space on a disk partition.  This can be set to SFS_NONE
  2454. !         (0) if you have no way of getting this information,
  2455. !         SFS_USTAT (1) if you have the ustat(2) system call,
  2456. !         SFS_4ARGS (2) if you have a four-argument statfs(2)
  2457. !         system call (and the include file is <sys/statfs.h>),
  2458. !         and SFS_VFS (3), SFS_MOUNT (4), or SFS_STATFS (5) if
  2459. !         you have the two-argument statfs(2) system call, with
  2460. !         includes in <sys/vfs.h>, <sys/mount.h>, or <sys/statfs.h>
  2461. !         respectively.  The default if nothing is defined is
  2462. !         SFS_NONE.
  2463.   ERRLIST_PREDEFINED
  2464.           If set, assumes that some header file defines sys_errlist.
  2465.           This may be needed if you get type conflicts on this
  2466. ***************
  2467. *** 301,306 ****
  2468. --- 319,330 ----
  2469.           e-mail message will log many more messages, since it
  2470.           will log each piece of information as a separate line
  2471.           in syslog.
  2472. + BROKEN_RES_SEARCH
  2473. +         On Ultrix (and maybe other systems?) if you use the
  2474. +         res_search routine with an unknown host name, it returns
  2475. +         -1 but sets h_errno to 0 instead of HOST_NOT_FOUND.  If
  2476. +         you set this, sendmail considers 0 to be the same as
  2477. +         HOST_NOT_FOUND.
  2478.   
  2479.   
  2480.   +-----------------------+
  2481. ***************
  2482. *** 371,377 ****
  2483.   the header files you used -- some people have used the 4.9 headers
  2484.   and linked with BIND 4.8 or vice versa, and it doesn't work.
  2485.   Unfortunately, it doesn't fail in an obvious way -- things just
  2486. ! subtlely don't work.
  2487.   
  2488.   
  2489.   +-------------------------------------+
  2490. --- 395,401 ----
  2491.   the header files you used -- some people have used the 4.9 headers
  2492.   and linked with BIND 4.8 or vice versa, and it doesn't work.
  2493.   Unfortunately, it doesn't fail in an obvious way -- things just
  2494. ! subtly don't work.
  2495.   
  2496.   
  2497.   +-------------------------------------+
  2498. ***************
  2499. *** 440,445 ****
  2500. --- 464,473 ----
  2501.   Solaris 2.x (SunOS 5.x)
  2502.       To compile for Solaris, be sure you use -DSOLARIS.
  2503.   
  2504. +     To the best of my knowledge, Solaris does not have the
  2505. +     gethostbyname problem described above.  However, it does
  2506. +     have another one:
  2507.       From a correspondent:
  2508.   
  2509.          For solaris 2.2, I have 
  2510. ***************
  2511. *** 450,467 ****
  2512.          qualified host name. I think "files" has to be before "dns"
  2513.          in /etc/nsswitch.conf during bootup.
  2514.   
  2515. !     To the best of my knowledge, Solaris does not have the
  2516. !     gethostbyname problem described above.
  2517.   
  2518.       The Solaris "syslog" function is apparently limited to something
  2519.       about 90 characters because of a kernel limitation.  If you have
  2520. !     source code, you can probably up this number.  The syslogd patch
  2521. !     is included in kernel jumbo patch for Solaris 2.2 as of revision
  2522. !     -39 or so.  At least one person is running with patch 100999-45
  2523. !     and their long lost sendmail logging is finally showing up.  At
  2524. !     least one other person is running with patch 101318 installed
  2525. !     under Solaris 2.3 with success.
  2526.   
  2527.   OSF/1
  2528.       If you are compiling on OSF/1 (DEC Alpha), you must use 
  2529.       -L/usr/shlib (otherwise it core dumps on startup).  You may also
  2530. --- 478,519 ----
  2531.          qualified host name. I think "files" has to be before "dns"
  2532.          in /etc/nsswitch.conf during bootup.
  2533.   
  2534. !     From another correspondent:
  2535.   
  2536. +        When running sendmail under Solaris, the gethostbyname()
  2537. +        hack in conf.c which should perform proper canonicalization
  2538. +        of host names could fail.  Result: the host name is not
  2539. +        canonicalized despite the hack, and you'll have to define $j
  2540. +        and $m in sendmail.cf somewhere.
  2541. +        The reason could be that /etc/nsswitch.conf is improperly
  2542. +        configured (at least from sendmail's point of view).  For
  2543. +        example, the line
  2544. +         hosts:      files nisplus dns
  2545. +        will make gethostbyname() look in /etc/hosts first, then ask
  2546. +        nisplus, then dns.  However, if /etc/hosts does not contain
  2547. +        the full canonicalized hostname, then no amount of
  2548. +        gethostbyname()s will work.
  2549. +        Solution (or rather, a workaround): Ask nisplus first, then
  2550. +        dns, then local files:
  2551. +         hosts:      nisplus dns [NOTFOUND=return] files
  2552.       The Solaris "syslog" function is apparently limited to something
  2553.       about 90 characters because of a kernel limitation.  If you have
  2554. !     source code, you can probably up this number.  You can get patches
  2555. !     that fix this problem: the patch ids are:
  2556.   
  2557. +         Solaris 2.1    100834
  2558. +         Solaris 2.2    100999
  2559. +         Solaris 2.3    101318
  2560. +     Be sure you have the appropriate patch installed or you won't
  2561. +     see system logging.
  2562.   OSF/1
  2563.       If you are compiling on OSF/1 (DEC Alpha), you must use 
  2564.       -L/usr/shlib (otherwise it core dumps on startup).  You may also
  2565. ***************
  2566. *** 471,476 ****
  2567. --- 523,539 ----
  2568.       Also, the enclosed makefile removed /usr/sbin/smtpd; if you need
  2569.       it, just create the link to the sendmail binary.
  2570.   
  2571. + IRIX
  2572. +     The header files on SGI IRIX are completely prototyped, and as
  2573. +     a result you can sometimes get some warning messages during
  2574. +     compilation.  These can be ignored.  There are two errors in
  2575. +     deliver only if you are using gcc, both of the form ``warning:
  2576. +     passing arg N of `execve' from incompatible pointer type''.
  2577. +     Also, if you compile with -DNIS, you will get a complaint
  2578. +     about a declaration of struct dom_binding in a prototype
  2579. +     when compiling map.c; this is not important because the
  2580. +     function being prototyped is not used in that file.
  2581.   NeXT
  2582.       If you are compiling on NeXT, you will have to create an empty
  2583.       file "unistd.h" and create a file "dirent.h" containing:
  2584. ***************
  2585. *** 560,565 ****
  2586. --- 623,672 ----
  2587.       DG/UX -- the person who has this working, Douglas Anderson
  2588.       <dlander@afterlife.ncsc.mil>, used procmail instead.
  2589.   
  2590. + Apollo DomainOS
  2591. +     If you are compiling on Apollo, you will have to create an empty
  2592. +     file "unistd.h" and create a file "dirent.h" containing:
  2593. +         #include <sys/dir.h>
  2594. +         #define dirent    direct
  2595. +     (The Makefile.DomainOS will attempt to do both of these for you.)
  2596. + HP-UX 8.00
  2597. +     Date: Mon, 24 Jan 1994 13:25:45 +0200
  2598. +     From: Kimmo Suominen <Kimmo.Suominen@lut.fi>
  2599. +     Subject: 8.6.5 w/ HP-UX 8.00 on s300
  2600. +     Just compiled and fought with sendmail 8.6.5 on a HP9000/360 (ie. a
  2601. +     series 300 machine) running HP-UX 8.00.
  2602. +     I was getting segmentation fault when delivering to a local user.
  2603. +     With debugging I saw it was faulting when doing _free@libc... *sigh*
  2604. +     It seems the new implementation of malloc on s300 is buggy as of 8.0,
  2605. +     so I tried out the one in -lmalloc (malloc(3X)).  With that it seems
  2606. +     to work just dandy.
  2607. +     When linking, you will get the following error:
  2608. +     ld: multiply defined symbol _freespace in file /usr/lib/libmalloc.a
  2609. +     but you can just ignore it.  You might want to add this info to the
  2610. +     README file for the future...
  2611. + Linux
  2612. +     Something broke between versions 0.99.13 and 0.99.14 of Linux:
  2613. +     the flock() system call gives errors.  If you are running .14,
  2614. +     you must not use flock.  You can do this with -DHASFLOCK=0.
  2615. + AIX
  2616. +     This version of sendmail does not support MB, MG, and MR resource
  2617. +     records, which are supported by AIX sendmail.
  2618. + RISC/os
  2619. +     RISC/os from MIPS is a merged AT&T/Berkeley system.  When you
  2620. +     compile on that platform you will get duplicate definitions
  2621. +     on many files.  You can ignore these.
  2622.   System V Release 4 Based Systems
  2623.       There is a single Makefile that is intended for all SVR4-based
  2624.       systems (called Makefile.SVR4).  It defines __svr4__, which is
  2625. ***************
  2626. *** 642,648 ****
  2627. --- 749,767 ----
  2628.       I'm told that GNU getopt has a problem in that it gets confused
  2629.       by the double call.  Use the version in conf.c instead.
  2630.   
  2631. + BIND 4.9.2 and Ultrix
  2632. +     If you are running on Ultrix, be sure you read the conf/Info.Ultrix
  2633. +     carefully -- there is information in there that you need to know
  2634. +     in order to avoid errors of the form:
  2635.   
  2636. +         /lib/libc.a(gethostent.o): sethostent: multiply defined
  2637. +         /lib/libc.a(gethostent.o): endhostent: multiply defined
  2638. +         /lib/libc.a(gethostent.o): gethostbyname: multiply defined
  2639. +         /lib/libc.a(gethostent.o): gethostbyaddr: multiply defined
  2640. +     during the link stage.
  2641.   +--------------+
  2642.   | MANUAL PAGES |
  2643.   +--------------+
  2644. ***************
  2645. *** 742,745 ****
  2646.   
  2647.   Eric Allman
  2648.   
  2649. ! (Version 8.47, last update 1/12/94 05:59:56)
  2650. --- 861,864 ----
  2651.   
  2652.   Eric Allman
  2653.   
  2654. ! (Version 8.58, last update 3/13/94 09:38:06)
  2655. *** src/alias.c.OLD    Sat Dec 11 14:21:35 1993
  2656. --- src/alias.c    Mon Feb 28 10:04:58 1994
  2657. ***************
  2658. *** 36,42 ****
  2659.   # include <pwd.h>
  2660.   
  2661.   #ifndef lint
  2662. ! static char sccsid[] = "@(#)alias.c    8.21 (Berkeley) 12/11/93";
  2663.   #endif /* not lint */
  2664.   
  2665.   
  2666. --- 36,42 ----
  2667.   # include <pwd.h>
  2668.   
  2669.   #ifndef lint
  2670. ! static char sccsid[] = "@(#)alias.c    8.24 (Berkeley) 2/28/94";
  2671.   #endif /* not lint */
  2672.   
  2673.   
  2674. ***************
  2675. *** 114,120 ****
  2676.       message("aliased to %s", p);
  2677.   #ifdef LOG
  2678.       if (LogLevel > 9)
  2679. !         syslog(LOG_INFO, "%s: alias %s => %s", e->e_id, a->q_paddr, p);
  2680.   #endif
  2681.       a->q_flags &= ~QSELFREF;
  2682.       AliasLevel++;
  2683. --- 114,122 ----
  2684.       message("aliased to %s", p);
  2685.   #ifdef LOG
  2686.       if (LogLevel > 9)
  2687. !         syslog(LOG_INFO, "%s: alias %s => %s",
  2688. !             e->e_id == NULL ? "NOQUEUE" : e->e_id,
  2689. !             a->q_paddr, p);
  2690.   #endif
  2691.       a->q_flags &= ~QSELFREF;
  2692.       AliasLevel++;
  2693. ***************
  2694. *** 417,423 ****
  2695.       /* try to lock the source file */
  2696.       if ((af = fopen(map->map_file, "r+")) == NULL)
  2697.       {
  2698. !         if (errno != EACCES || automatic ||
  2699.               (af = fopen(map->map_file, "r")) == NULL)
  2700.           {
  2701.               int saveerr = errno;
  2702. --- 419,425 ----
  2703.       /* try to lock the source file */
  2704.       if ((af = fopen(map->map_file, "r+")) == NULL)
  2705.       {
  2706. !         if ((errno != EACCES && errno != EROFS) || automatic ||
  2707.               (af = fopen(map->map_file, "r")) == NULL)
  2708.           {
  2709.               int saveerr = errno;
  2710. ***************
  2711. *** 748,754 ****
  2712.   #ifdef LOG
  2713.               if (LogLevel > 2)
  2714.                   syslog(LOG_ERR, "%s: forward %s: transient error: %s",
  2715. !                     e->e_id, buf, errstring(err));
  2716.   #endif
  2717.               message("%s: %s: message queued", buf, errstring(err));
  2718.               user->q_flags |= QQUEUEUP;
  2719. --- 750,757 ----
  2720.   #ifdef LOG
  2721.               if (LogLevel > 2)
  2722.                   syslog(LOG_ERR, "%s: forward %s: transient error: %s",
  2723. !                     e->e_id == NULL ? "NOQUEUE" : e->e_id,
  2724. !                     buf, errstring(err));
  2725.   #endif
  2726.               message("%s: %s: message queued", buf, errstring(err));
  2727.               user->q_flags |= QQUEUEUP;
  2728. *** src/collect.c.OLD    Sat Jan  8 17:29:31 1994
  2729. --- src/collect.c    Mon Jan 31 17:01:17 1994
  2730. ***************
  2731. *** 33,39 ****
  2732.    */
  2733.   
  2734.   #ifndef lint
  2735. ! static char sccsid[] = "@(#)collect.c    8.8 (Berkeley) 1/8/94";
  2736.   #endif /* not lint */
  2737.   
  2738.   # include <errno.h>
  2739. --- 33,39 ----
  2740.    */
  2741.   
  2742.   #ifndef lint
  2743. ! static char sccsid[] = "@(#)collect.c    8.9 (Berkeley) 1/31/94";
  2744.   #endif /* not lint */
  2745.   
  2746.   # include <errno.h>
  2747. ***************
  2748. *** 317,324 ****
  2749.                   "collect: %s on connection from %s, sender=%s: %m\n",
  2750.                   problem, host, e->e_from.q_paddr);
  2751.   # endif
  2752. !         (feof(InChannel) ? usrerr : syserr)
  2753. !             ("451 collect: %s on connection from %s, from=%s",
  2754.                   problem, host, e->e_from.q_paddr);
  2755.   
  2756.           /* don't return an error indication */
  2757. --- 317,327 ----
  2758.                   "collect: %s on connection from %s, sender=%s: %m\n",
  2759.                   problem, host, e->e_from.q_paddr);
  2760.   # endif
  2761. !         if (feof(InChannel))
  2762. !             usrerr("451 collect: %s on connection from %s, from=%s",
  2763. !                 problem, host, e->e_from.q_paddr);
  2764. !         else
  2765. !             syserr("451 collect: %s on connection from %s, from=%s",
  2766.                   problem, host, e->e_from.q_paddr);
  2767.   
  2768.           /* don't return an error indication */
  2769. *** src/conf.c.OLD    Tue Jan 11 07:04:01 1994
  2770. --- src/conf.c    Sun Mar  6 09:31:18 1994
  2771. ***************
  2772. *** 33,39 ****
  2773.    */
  2774.   
  2775.   #ifndef lint
  2776. ! static char sccsid[] = "@(#)conf.c    8.62 (Berkeley) 1/9/94";
  2777.   #endif /* not lint */
  2778.   
  2779.   # include "sendmail.h"
  2780. --- 33,39 ----
  2781.    */
  2782.   
  2783.   #ifndef lint
  2784. ! static char sccsid[] = "@(#)conf.c    8.82 (Berkeley) 3/6/94";
  2785.   #endif /* not lint */
  2786.   
  2787.   # include "sendmail.h"
  2788. ***************
  2789. *** 628,633 ****
  2790. --- 628,634 ----
  2791.   #define LA_SUBR        4    /* call getloadavg */
  2792.   #define LA_MACH        5    /* MACH load averages (as on NeXT boxes) */
  2793.   #define LA_SHORT    6    /* read kmem for avenrun; interpret as short */
  2794. + #define LA_PROCSTR    7    /* read string ("1.17") from /proc/loadavg */
  2795.   
  2796.   /* do guesses based on general OS type */
  2797.   #ifndef LA_TYPE
  2798. ***************
  2799. *** 827,836 ****
  2800. --- 828,883 ----
  2801.   
  2802.   
  2803.   #else
  2804. + #if LA_TYPE == LA_PROCSTR
  2805.   
  2806. + /*
  2807. + **  Read /proc/loadavg for the load average.  This is assumed to be
  2808. + **  in a format like "0.15 0.12 0.06".
  2809. + **
  2810. + **    Initially intended for Linux.  This has been in the kernel
  2811. + **    since at least 0.99.15.
  2812. + */
  2813. + # ifndef _PATH_LOADAVG
  2814. + #  define _PATH_LOADAVG    "/proc/loadavg"
  2815. + # endif
  2816. + int
  2817.   getla()
  2818.   {
  2819. +     double avenrun;
  2820. +     register int result;
  2821. +     FILE *fp;
  2822. +     fp = fopen(_PATH_LOADAVG, "r");
  2823. +     if (fp == NULL) 
  2824. +     {
  2825. +         if (tTd(3, 1))
  2826. +             printf("getla: fopen(%s): %s\n",
  2827. +                 _PATH_LOADAVG, errstring(errno));
  2828. +         return -1;
  2829. +     }
  2830. +     result = fscanf(fp, "%lf", &avenrun);
  2831. +     fclose(fp);
  2832. +     if (result != 1)
  2833. +     {
  2834. +         if (tTd(3, 1))
  2835. +             printf("getla: fscanf() = %d: %s\n",
  2836. +                 result, errstring(errno));
  2837. +         return -1;
  2838. +     }
  2839.       if (tTd(3, 1))
  2840. +         printf("getla(): %.2f\n", avenrun);
  2841. +     return ((int) (avenrun + 0.5));
  2842. + }
  2843. + #else
  2844. + getla()
  2845. + {
  2846. +     if (tTd(3, 1))
  2847.           printf("getla: ZERO\n");
  2848.       return (0);
  2849.   }
  2850. ***************
  2851. *** 838,843 ****
  2852. --- 885,938 ----
  2853.   #endif
  2854.   #endif
  2855.   #endif
  2856. + #endif
  2857. + /*
  2858. +  * Copyright 1989 Massachusetts Institute of Technology
  2859. +  *
  2860. +  * Permission to use, copy, modify, distribute, and sell this software and its
  2861. +  * documentation for any purpose is hereby granted without fee, provided that
  2862. +  * the above copyright notice appear in all copies and that both that
  2863. +  * copyright notice and this permission notice appear in supporting
  2864. +  * documentation, and that the name of M.I.T. not be used in advertising or
  2865. +  * publicity pertaining to distribution of the software without specific,
  2866. +  * written prior permission.  M.I.T. makes no representations about the
  2867. +  * suitability of this software for any purpose.  It is provided "as is"
  2868. +  * without express or implied warranty.
  2869. +  *
  2870. +  * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  2871. +  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
  2872. +  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  2873. +  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  2874. +  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  2875. +  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  2876. +  *
  2877. +  * Authors:  Many and varied...
  2878. +  */
  2879. + /* Non Apollo stuff removed by Don Lewis 11/15/93 */
  2880. + #ifndef lint
  2881. + static char  rcsid[] = "@(#)$Id: getloadavg.c,v 1.16 1991/06/21 12:51:15 paul Exp $";
  2882. + #endif /* !lint */
  2883. + #ifdef apollo
  2884. + # undef volatile
  2885. + #    include <apollo/base.h>
  2886. + /* ARGSUSED */
  2887. + int getloadavg( call_data )
  2888. +      caddr_t    call_data;    /* pointer to (double) return value */
  2889. + {
  2890. +      double *avenrun = (double *) call_data;
  2891. +      int i;
  2892. +      status_$t      st;
  2893. +      long loadav[3];
  2894. +      proc1_$get_loadav(loadav, &st);
  2895. +      *avenrun = loadav[0] / (double) (1 << 16);
  2896. +      return(0);
  2897. + }
  2898. + #   endif /* apollo */
  2899.    /*
  2900.   **  SHOULDQUEUE -- should this message be queued or sent?
  2901.   **
  2902. ***************
  2903. *** 909,914 ****
  2904. --- 1004,1012 ----
  2905.   */
  2906.   
  2907.   #ifdef SETPROCTITLE
  2908. + # ifdef HASSETPROCTITLE
  2909. +    *** ERROR ***  Cannot have both SETPROCTITLE and HASSETPROCTITLE defined
  2910. + # endif
  2911.   # ifdef __hpux
  2912.   #  include <sys/pstat.h>
  2913.   # endif
  2914. ***************
  2915. *** 932,937 ****
  2916. --- 1030,1037 ----
  2917.   # define PROCTITLEPAD    ' '
  2918.   #endif
  2919.   
  2920. + #ifndef HASSETPROCTITLE
  2921.   /*VARARGS1*/
  2922.   #ifdef __STDC__
  2923.   setproctitle(char *fmt, ...)
  2924. ***************
  2925. *** 986,991 ****
  2926. --- 1086,1093 ----
  2927.   #  endif
  2928.   # endif /* SETPROCTITLE */
  2929.   }
  2930. + #endif
  2931.    /*
  2932.   **  REAPCHILD -- pick up the body of my child, lest it become a zombie
  2933.   **
  2934. ***************
  2935. *** 1407,1412 ****
  2936. --- 1509,1516 ----
  2937.   
  2938.   #endif
  2939.   
  2940. + #define WILDCARD_SHELL    "/SENDMAIL/ANY/SHELL/"
  2941.   bool
  2942.   usershellok(shell)
  2943.       char *shell;
  2944. ***************
  2945. *** 1417,1423 ****
  2946.   
  2947.       setusershell();
  2948.       while ((p = getusershell()) != NULL)
  2949. !         if (strcmp(p, shell) == 0 || strcmp(p, "*") == 0)
  2950.               break;
  2951.       endusershell();
  2952.       return p != NULL;
  2953. --- 1521,1527 ----
  2954.   
  2955.       setusershell();
  2956.       while ((p = getusershell()) != NULL)
  2957. !         if (strcmp(p, shell) == 0 || strcmp(p, WILDCARD_SHELL) == 0)
  2958.               break;
  2959.       endusershell();
  2960.       return p != NULL;
  2961. ***************
  2962. *** 1452,1458 ****
  2963.           while (*p != '\0' && *p != '#' && !isspace(*p))
  2964.               p++;
  2965.           *p = '\0';
  2966. !         if (strcmp(shell, q) == 0 || strcmp("*", q) == 0)
  2967.           {
  2968.               fclose(shellf);
  2969.               return TRUE;
  2970. --- 1556,1562 ----
  2971.           while (*p != '\0' && *p != '#' && !isspace(*p))
  2972.               p++;
  2973.           *p = '\0';
  2974. !         if (strcmp(shell, q) == 0 || strcmp(WILDCARD_SHELL, q) == 0)
  2975.           {
  2976.               fclose(shellf);
  2977.               return TRUE;
  2978. ***************
  2979. *** 1480,1504 ****
  2980.   **        Puts the filesystem block size into bsize.
  2981.   */
  2982.   
  2983. ! #ifdef HASSTATFS
  2984. ! # undef HASUSTAT
  2985.   #endif
  2986.   
  2987. ! #if defined(HASUSTAT)
  2988.   # include <ustat.h>
  2989.   #endif
  2990. ! #ifdef HASSTATFS
  2991. ! # if defined(IRIX) || defined(apollo) || defined(_SCO_unix_) || defined(UMAXV) || defined(DGUX) || defined(_AIX3)
  2992. ! #  include <sys/statfs.h>
  2993. ! # else
  2994. ! #  if (defined(sun) && !defined(BSD)) || defined(__hpux) || defined(_CONVEX_SOURCE) || defined(NeXT) || defined(_AUX_SOURCE) || defined(MACH386)
  2995. ! #   include <sys/vfs.h>
  2996. ! #  else
  2997. ! #   include <sys/mount.h>
  2998. ! #  endif
  2999. ! # endif
  3000.   #endif
  3001.   
  3002.   long
  3003.   freespace(dir, bsize)
  3004. --- 1584,1613 ----
  3005.   **        Puts the filesystem block size into bsize.
  3006.   */
  3007.   
  3008. ! /* statfs types */
  3009. ! #define SFS_NONE    0    /* no statfs implementation */
  3010. ! #define SFS_USTAT    1    /* use ustat */
  3011. ! #define SFS_4ARGS    2    /* use four-argument statfs call */
  3012. ! #define SFS_VFS        3    /* use <sys/vfs.h> implementation */
  3013. ! #define SFS_MOUNT    4    /* use <sys/mount.h> implementation */
  3014. ! #define SFS_STATFS    5    /* use <sys/statfs.h> implementation */
  3015. ! #ifndef SFS_TYPE
  3016. ! # define SFS_TYPE    SFS_NONE
  3017.   #endif
  3018.   
  3019. ! #if SFS_TYPE == SFS_USTAT
  3020.   # include <ustat.h>
  3021.   #endif
  3022. ! #if SFS_TYPE == SFS_4ARGS || SFS_TYPE == SFS_STATFS
  3023. ! # include <sys/statfs.h>
  3024.   #endif
  3025. + #if SFS_TYPE == SFS_VFS
  3026. + # include <sys/vfs.h>
  3027. + #endif
  3028. + #if SFS_TYPE == SFS_MOUNT
  3029. + # include <sys/mount.h>
  3030. + #endif
  3031.   
  3032.   long
  3033.   freespace(dir, bsize)
  3034. ***************
  3035. *** 1505,1512 ****
  3036.       char *dir;
  3037.       long *bsize;
  3038.   {
  3039. ! #if defined(HASSTATFS) || defined(HASUSTAT)
  3040. ! # if defined(HASUSTAT)
  3041.       struct ustat fs;
  3042.       struct stat statbuf;
  3043.   #  define FSBLOCKSIZE    DEV_BSIZE
  3044. --- 1614,1621 ----
  3045.       char *dir;
  3046.       long *bsize;
  3047.   {
  3048. ! #if SFS_TYPE != SFS_NONE
  3049. ! # if SFS_TYPE == SFS_USTAT
  3050.       struct ustat fs;
  3051.       struct stat statbuf;
  3052.   #  define FSBLOCKSIZE    DEV_BSIZE
  3053. ***************
  3054. *** 1519,1525 ****
  3055.   #  else
  3056.       struct statfs fs;
  3057.   #   define FSBLOCKSIZE    fs.f_bsize
  3058. ! #   if defined(_SCO_unix_) || defined(IRIX)
  3059.   #    define f_bavail f_bfree
  3060.   #   endif
  3061.   #  endif
  3062. --- 1628,1634 ----
  3063.   #  else
  3064.       struct statfs fs;
  3065.   #   define FSBLOCKSIZE    fs.f_bsize
  3066. ! #   if defined(_SCO_unix_) || defined(IRIX) || defined(apollo)
  3067.   #    define f_bavail f_bfree
  3068.   #   endif
  3069.   #  endif
  3070. ***************
  3071. *** 1526,1535 ****
  3072.   # endif
  3073.       extern int errno;
  3074.   
  3075. ! # if defined(HASUSTAT)
  3076.       if (stat(dir, &statbuf) == 0 && ustat(statbuf.st_dev, &fs) == 0)
  3077.   # else
  3078. ! #  if defined(IRIX) || defined(apollo) || defined(UMAXV) || defined(DGUX)
  3079.       if (statfs(dir, &fs, sizeof fs, 0) == 0)
  3080.   #  else
  3081.   #   if defined(ultrix)
  3082. --- 1635,1644 ----
  3083.   # endif
  3084.       extern int errno;
  3085.   
  3086. ! # if SFS_TYPE == SFS_USTAT
  3087.       if (stat(dir, &statbuf) == 0 && ustat(statbuf.st_dev, &fs) == 0)
  3088.   # else
  3089. ! #  if SFS_TYPE == SFS_4ARGS
  3090.       if (statfs(dir, &fs, sizeof fs, 0) == 0)
  3091.   #  else
  3092.   #   if defined(ultrix)
  3093. ***************
  3094. *** 1694,1699 ****
  3095. --- 1803,1811 ----
  3096.   #ifdef EADDRNOTAVAIL
  3097.         case EADDRNOTAVAIL:        /* Can't assign requested address */
  3098.   #endif
  3099. + #ifdef ETXTBSY
  3100. +       case ETXTBSY:            /* (Apollo) file locked */
  3101. + #endif
  3102.   #if defined(ENOSR) && (!defined(ENOBUFS) || (ENOBUFS != ENOSR))
  3103.         case ENOSR:            /* Out of streams resources */
  3104.   #endif
  3105. ***************
  3106. *** 1726,1732 ****
  3107.       char *ext;
  3108.       int type;
  3109.   {
  3110. ! # ifndef HASFLOCK
  3111.       int action;
  3112.       struct flock lfd;
  3113.   
  3114. --- 1838,1844 ----
  3115.       char *ext;
  3116.       int type;
  3117.   {
  3118. ! # if !HASFLOCK
  3119.       int action;
  3120.       struct flock lfd;
  3121.   
  3122. ***************
  3123. *** 1823,1828 ****
  3124. --- 1935,1999 ----
  3125.       return FALSE;
  3126.   }
  3127.    /*
  3128. + **  CHOWNSAFE -- tell if chown is "safe" (executable only by root)
  3129. + **
  3130. + **    Parameters:
  3131. + **        fd -- the file descriptor to check.
  3132. + **
  3133. + **    Returns:
  3134. + **        TRUE -- if only root can chown the file to an arbitrary
  3135. + **            user.
  3136. + **        FALSE -- if an arbitrary user can give away a file.
  3137. + */
  3138. + bool
  3139. + chownsafe(fd)
  3140. +     int fd;
  3141. + {
  3142. + #ifdef __hpux
  3143. +     char *s;
  3144. +     int tfd;
  3145. +     uid_t o_uid, o_euid;
  3146. +     gid_t o_gid, o_egid;
  3147. +     bool rval;
  3148. +     struct stat stbuf;
  3149. +     o_uid = getuid();
  3150. +     o_euid = geteuid();
  3151. +     o_gid = getgid();
  3152. +     o_egid = getegid();
  3153. +     fstat(fd, &stbuf);
  3154. +     setresuid(stbuf.st_uid, stbuf.st_uid, -1);
  3155. +     setresgid(stbuf.st_gid, stbuf.st_gid, -1);
  3156. +     s = tmpnam(NULL);
  3157. +     tfd = open(s, O_RDONLY|O_CREAT, 0600);
  3158. +     rval = fchown(tfd, DefUid, DefGid) != 0;
  3159. +     close(tfd);
  3160. +     unlink(s);
  3161. +     setreuid(o_uid, o_euid);
  3162. +     setresgid(o_gid, o_egid, -1);
  3163. +     return rval;
  3164. + #else
  3165. + # ifdef _POSIX_CHOWN_RESTRICTED
  3166. + #  if _POSIX_CHOWN_RESTRICTED == -1
  3167. +     return FALSE;
  3168. + #  else
  3169. +     return TRUE;
  3170. + #  endif
  3171. + # else
  3172. + #  ifdef _PC_CHOWN_RESTRICTED
  3173. +     return fpathconf(fd, _PC_CHOWN_RESTRICTED) > 0;
  3174. + #  else
  3175. + #   ifdef BSD
  3176. +     return TRUE;
  3177. + #   else
  3178. +     return FALSE;
  3179. + #   endif
  3180. + #  endif
  3181. + # endif
  3182. + #endif
  3183. + }
  3184. +  /*
  3185.   **  GETCFNAME -- return the name of the .cf file.
  3186.   **
  3187.   **    Some systems (e.g., NeXT) determine this dynamically.
  3188. ***************
  3189. *** 1877,1922 ****
  3190.   **  STRTOL -- convert string to long integer
  3191.   **
  3192.   **    For systems that don't have it in the C library.
  3193.   */
  3194.   
  3195.   #ifdef NEEDSTRTOL
  3196.   
  3197.   long
  3198. ! strtol(p, ep, b)
  3199. !     char *p;
  3200. !     char **ep;
  3201. !     int b;
  3202.   {
  3203. !     long l = 0;
  3204. !     char c;
  3205. !     char maxd;
  3206. !     int neg = 1;
  3207.   
  3208. !     maxd = (b > 10) ? '9' : b + '0';
  3209. !     if (p && *p == '-') {
  3210. !         neg = -1;
  3211. !         p++;
  3212.       }
  3213. !     while (p && (c = *p)) {
  3214. !         if (c >= '0' && c <= maxd) {
  3215. !             l = l*b + *p++ - '0';
  3216. !             continue;
  3217.           }
  3218. -         if (c >= 'A' && c <= 'Z')
  3219. -             c -= 'A' + 'a';
  3220. -         c = c - 'a' + 10;
  3221. -         if (b > c) {
  3222. -             l = l*b + c;
  3223. -             p++;
  3224. -             continue;
  3225. -         }
  3226. -         break;
  3227.       }
  3228. !     l *= neg;
  3229. !     if (ep)
  3230. !         *ep = p;
  3231. !     return l;
  3232.   }
  3233.   
  3234.   #endif
  3235. --- 2048,2151 ----
  3236.   **  STRTOL -- convert string to long integer
  3237.   **
  3238.   **    For systems that don't have it in the C library.
  3239. + **
  3240. + **    This is taken verbatim from the 4.4-Lite C library.
  3241.   */
  3242.   
  3243.   #ifdef NEEDSTRTOL
  3244.   
  3245. + #if defined(LIBC_SCCS) && !defined(lint)
  3246. + static char sccsid[] = "@(#)strtol.c    8.1 (Berkeley) 6/4/93";
  3247. + #endif /* LIBC_SCCS and not lint */
  3248. + #include <limits.h>
  3249. + /*
  3250. +  * Convert a string to a long integer.
  3251. +  *
  3252. +  * Ignores `locale' stuff.  Assumes that the upper and lower case
  3253. +  * alphabets and digits are each contiguous.
  3254. +  */
  3255.   long
  3256. ! strtol(nptr, endptr, base)
  3257. !     const char *nptr;
  3258. !     char **endptr;
  3259. !     register int base;
  3260.   {
  3261. !     register const char *s = nptr;
  3262. !     register unsigned long acc;
  3263. !     register int c;
  3264. !     register unsigned long cutoff;
  3265. !     register int neg = 0, any, cutlim;
  3266.   
  3267. !     /*
  3268. !      * Skip white space and pick up leading +/- sign if any.
  3269. !      * If base is 0, allow 0x for hex and 0 for octal, else
  3270. !      * assume decimal; if base is already 16, allow 0x.
  3271. !      */
  3272. !     do {
  3273. !         c = *s++;
  3274. !     } while (isspace(c));
  3275. !     if (c == '-') {
  3276. !         neg = 1;
  3277. !         c = *s++;
  3278. !     } else if (c == '+')
  3279. !         c = *s++;
  3280. !     if ((base == 0 || base == 16) &&
  3281. !         c == '0' && (*s == 'x' || *s == 'X')) {
  3282. !         c = s[1];
  3283. !         s += 2;
  3284. !         base = 16;
  3285.       }
  3286. !     if (base == 0)
  3287. !         base = c == '0' ? 8 : 10;
  3288. !     /*
  3289. !      * Compute the cutoff value between legal numbers and illegal
  3290. !      * numbers.  That is the largest legal value, divided by the
  3291. !      * base.  An input number that is greater than this value, if
  3292. !      * followed by a legal input character, is too big.  One that
  3293. !      * is equal to this value may be valid or not; the limit
  3294. !      * between valid and invalid numbers is then based on the last
  3295. !      * digit.  For instance, if the range for longs is
  3296. !      * [-2147483648..2147483647] and the input base is 10,
  3297. !      * cutoff will be set to 214748364 and cutlim to either
  3298. !      * 7 (neg==0) or 8 (neg==1), meaning that if we have accumulated
  3299. !      * a value > 214748364, or equal but the next digit is > 7 (or 8),
  3300. !      * the number is too big, and we will return a range error.
  3301. !      *
  3302. !      * Set any if any `digits' consumed; make it negative to indicate
  3303. !      * overflow.
  3304. !      */
  3305. !     cutoff = neg ? -(unsigned long)LONG_MIN : LONG_MAX;
  3306. !     cutlim = cutoff % (unsigned long)base;
  3307. !     cutoff /= (unsigned long)base;
  3308. !     for (acc = 0, any = 0;; c = *s++) {
  3309. !         if (isdigit(c))
  3310. !             c -= '0';
  3311. !         else if (isalpha(c))
  3312. !             c -= isupper(c) ? 'A' - 10 : 'a' - 10;
  3313. !         else
  3314. !             break;
  3315. !         if (c >= base)
  3316. !             break;
  3317. !         if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim)
  3318. !             any = -1;
  3319. !         else {
  3320. !             any = 1;
  3321. !             acc *= base;
  3322. !             acc += c;
  3323.           }
  3324.       }
  3325. !     if (any < 0) {
  3326. !         acc = neg ? LONG_MIN : LONG_MAX;
  3327. !         errno = ERANGE;
  3328. !     } else if (neg)
  3329. !         acc = -acc;
  3330. !     if (endptr != 0)
  3331. !         *endptr = (char *)(any ? s - 1 : nptr);
  3332. !     return (acc);
  3333.   }
  3334.   
  3335.   #endif
  3336. ***************
  3337. *** 1998,2004 ****
  3338.       char *directory;
  3339.       char *propname;
  3340.   {
  3341. !     char *propval;
  3342.       int i;
  3343.       void *ni = NULL;
  3344.       void *lastni = NULL;
  3345. --- 2227,2233 ----
  3346.       char *directory;
  3347.       char *propname;
  3348.   {
  3349. !     char *propval = NULL;
  3350.       int i;
  3351.       void *ni = NULL;
  3352.       void *lastni = NULL;
  3353. *** src/conf.h.OLD    Sat Jan  8 17:53:13 1994
  3354. --- src/conf.h    Fri Mar 11 14:42:24 1994
  3355. ***************
  3356. *** 31,37 ****
  3357.    * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  3358.    * SUCH DAMAGE.
  3359.    *
  3360. !  *    @(#)conf.h    8.75 (Berkeley) 1/8/94
  3361.    */
  3362.   
  3363.   /*
  3364. --- 31,37 ----
  3365.    * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  3366.    * SUCH DAMAGE.
  3367.    *
  3368. !  *    @(#)conf.h    8.96 (Berkeley) 3/11/94
  3369.    */
  3370.   
  3371.   /*
  3372. ***************
  3373. *** 80,93 ****
  3374.   # define NETUNIX    1    /* include unix domain support */
  3375.   # define NETINET    1    /* include internet support */
  3376.   # define SETPROCTITLE    1    /* munge argv to display current status */
  3377. - # define NAMED_BIND    1    /* use Berkeley Internet Domain Server */
  3378.   # define MATCHGECOS    1    /* match user names from gecos field */
  3379.   # define XDEBUG        1    /* enable extended debugging */
  3380.   # ifdef NEWDB
  3381.   # define USERDB        1    /* look in user database (requires NEWDB) */
  3382.   # endif
  3383.   
  3384.   /*
  3385.   **  Most systems have symbolic links today, so default them on.  You
  3386.   **  can turn them off by #undef'ing this below.
  3387. --- 80,101 ----
  3388.   # define NETUNIX    1    /* include unix domain support */
  3389.   # define NETINET    1    /* include internet support */
  3390.   # define SETPROCTITLE    1    /* munge argv to display current status */
  3391.   # define MATCHGECOS    1    /* match user names from gecos field */
  3392.   # define XDEBUG        1    /* enable extended debugging */
  3393.   # ifdef NEWDB
  3394.   # define USERDB        1    /* look in user database (requires NEWDB) */
  3395.   # endif
  3396.   
  3397. + /**********************************************************************
  3398. + **  0/1 Compilation options.
  3399. + **    #define these to 1 if they are available;
  3400. + **    #define them to 0 otherwise.
  3401. + **********************************************************************/
  3402. + # ifndef NAMED_BIND
  3403. + #  define NAMED_BIND    1    /* use Berkeley Internet Domain Server */
  3404. + # endif
  3405.   /*
  3406.   **  Most systems have symbolic links today, so default them on.  You
  3407.   **  can turn them off by #undef'ing this below.
  3408. ***************
  3409. *** 131,140 ****
  3410.   # undef m_flags
  3411.   # define SYSTEM5    1    /* include all the System V defines */
  3412.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  3413. - # define HASSTATFS    1    /* has the statfs(2) syscall */
  3414.   # define HASSETREUID    1    /* has setreuid(2) call */
  3415. ! # define setreuid(r, e)        setresuid(r, e, -1)    
  3416.   # define LA_TYPE    LA_FLOAT
  3417.   # define GIDSET_T    gid_t
  3418.   # define _PATH_UNIX    "/hp-ux"
  3419.   # ifndef _PATH_SENDMAILCF
  3420. --- 139,148 ----
  3421.   # undef m_flags
  3422.   # define SYSTEM5    1    /* include all the System V defines */
  3423.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  3424.   # define HASSETREUID    1    /* has setreuid(2) call */
  3425. ! # define setreuid(r, e)        setresuid(r, e, -1)
  3426.   # define LA_TYPE    LA_FLOAT
  3427. + # define SFS_TYPE    SFS_VFS    /* use <sys/vfs.h> statfs() implementation */
  3428.   # define GIDSET_T    gid_t
  3429.   # define _PATH_UNIX    "/hp-ux"
  3430.   # ifndef _PATH_SENDMAILCF
  3431. ***************
  3432. *** 159,169 ****
  3433.   
  3434.   # ifdef _AIX3
  3435.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  3436. - # define HASSTATFS    1    /* has the statfs(2) syscall */
  3437.   # define HASUNAME    1    /* use System V uname(2) system call */
  3438.   # define HASGETUSERSHELL 0    /* does not have getusershell(3) call */
  3439.   # define FORK        fork    /* no vfork primitive available */
  3440.   # undef  SETPROCTITLE        /* setproctitle confuses AIX */
  3441.   # endif
  3442.   
  3443.   
  3444. --- 167,177 ----
  3445.   
  3446.   # ifdef _AIX3
  3447.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  3448.   # define HASUNAME    1    /* use System V uname(2) system call */
  3449.   # define HASGETUSERSHELL 0    /* does not have getusershell(3) call */
  3450.   # define FORK        fork    /* no vfork primitive available */
  3451.   # undef  SETPROCTITLE        /* setproctitle confuses AIX */
  3452. + # define SFS_TYPE    SFS_STATFS    /* use <sys/statfs.h> statfs() impl */
  3453.   # endif
  3454.   
  3455.   
  3456. ***************
  3457. *** 177,188 ****
  3458.   # include <sys/sysmacros.h>
  3459.   # define HASSETREUID    1    /* has setreuid(2) call */
  3460.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  3461. - # define HASSTATFS    1    /* has the statfs(2) syscall */
  3462.   # define HASGETUSERSHELL 0    /* does not have getusershell(3) call */
  3463.   # define FORK        fork    /* no vfork primitive available */
  3464.   # define WAITUNION    1    /* use "union wait" as wait argument type */
  3465.   # define setpgid    BSDsetpgrp
  3466.   # define GIDSET_T    gid_t
  3467.   # endif
  3468.   
  3469.   
  3470. --- 185,196 ----
  3471.   # include <sys/sysmacros.h>
  3472.   # define HASSETREUID    1    /* has setreuid(2) call */
  3473.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  3474.   # define HASGETUSERSHELL 0    /* does not have getusershell(3) call */
  3475.   # define FORK        fork    /* no vfork primitive available */
  3476.   # define WAITUNION    1    /* use "union wait" as wait argument type */
  3477.   # define setpgid    BSDsetpgrp
  3478.   # define GIDSET_T    gid_t
  3479. + # define SFS_TYPE    SFS_4ARGS    /* four argument statfs() call */
  3480.   # endif
  3481.   
  3482.   
  3483. ***************
  3484. *** 195,204 ****
  3485.   
  3486.   #if defined(sun) && !defined(BSD)
  3487.   
  3488. - # define LA_TYPE    LA_INT
  3489.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  3490.   # define HASUNAME    1    /* use System V uname(2) system call */
  3491.   # define HASGETUSERSHELL 1    /* DOES have getusershell(3) call in libc */
  3492.   
  3493.   # ifdef SOLARIS_2_3
  3494.   #  define SOLARIS
  3495. --- 203,212 ----
  3496.   
  3497.   #if defined(sun) && !defined(BSD)
  3498.   
  3499.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  3500.   # define HASUNAME    1    /* use System V uname(2) system call */
  3501.   # define HASGETUSERSHELL 1    /* DOES have getusershell(3) call in libc */
  3502. + # define LA_TYPE    LA_INT
  3503.   
  3504.   # ifdef SOLARIS_2_3
  3505.   #  define SOLARIS
  3506. ***************
  3507. *** 222,233 ****
  3508.   #  ifndef _PATH_SENDMAILPID
  3509.   #   define _PATH_SENDMAILPID    "/etc/mail/sendmail.pid"
  3510.   #  endif
  3511.   
  3512.   # else
  3513.               /* SunOS 4.0.3 or 4.1.x */
  3514.   #  define HASSETREUID    1    /* has setreuid(2) call */
  3515. ! #  define HASSTATFS    1    /* has the statfs(2) syscall */
  3516. ! #  define HASFLOCK    1    /* has flock(2) call */
  3517.   #  include <vfork.h>
  3518.   
  3519.   #  ifdef SUNOS403
  3520. --- 230,246 ----
  3521.   #  ifndef _PATH_SENDMAILPID
  3522.   #   define _PATH_SENDMAILPID    "/etc/mail/sendmail.pid"
  3523.   #  endif
  3524. + #  ifndef SYSLOG_BUFSIZE
  3525. + #   define SYSLOG_BUFSIZE    1024    /* allow full size syslog buffer */
  3526. + #  endif
  3527.   
  3528.   # else
  3529.               /* SunOS 4.0.3 or 4.1.x */
  3530.   #  define HASSETREUID    1    /* has setreuid(2) call */
  3531. ! #  ifndef HASFLOCK
  3532. ! #   define HASFLOCK    1    /* has flock(2) call */
  3533. ! #  endif
  3534. ! #  define SFS_TYPE    SFS_VFS    /* use <sys/vfs.h> statfs() implementation */
  3535.   #  include <vfork.h>
  3536.   
  3537.   #  ifdef SUNOS403
  3538. ***************
  3539. *** 255,269 ****
  3540.   #ifdef    DGUX
  3541.   # define SYSTEM5    1
  3542.   # define LA_TYPE    LA_SUBR
  3543. - # define HASSTATFS    1    /* has the statfs(2) syscall */
  3544.   # define HASSETREUID    1    /* has setreuid(2) call */
  3545.   # define HASUNAME    1    /* use System V uname(2) system call */
  3546.   # define HASSETSID    1    /* has Posix setsid(2) call */
  3547.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  3548.   # ifndef IDENTPROTO
  3549.   #  define IDENTPROTO    0    /* TCP/IP implementation is broken */
  3550.   # endif
  3551.   # undef SETPROCTITLE
  3552.   
  3553.   /* these include files must be included early on DG/UX */
  3554.   # include <netinet/in.h>
  3555. --- 268,283 ----
  3556.   #ifdef    DGUX
  3557.   # define SYSTEM5    1
  3558.   # define LA_TYPE    LA_SUBR
  3559.   # define HASSETREUID    1    /* has setreuid(2) call */
  3560.   # define HASUNAME    1    /* use System V uname(2) system call */
  3561.   # define HASSETSID    1    /* has Posix setsid(2) call */
  3562.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  3563. + # define HASGETUSERSHELL 0    /* does not have getusershell(3) */
  3564.   # ifndef IDENTPROTO
  3565.   #  define IDENTPROTO    0    /* TCP/IP implementation is broken */
  3566.   # endif
  3567.   # undef SETPROCTITLE
  3568. + # define SFS_TYPE    SFS_4ARGS    /* four argument statfs() call */
  3569.   
  3570.   /* these include files must be included early on DG/UX */
  3571.   # include <netinet/in.h>
  3572. ***************
  3573. *** 283,294 ****
  3574.   */
  3575.   
  3576.   #ifdef ultrix
  3577. - # define HASSTATFS    1    /* has the statfs(2) syscall */
  3578.   # define HASSETREUID    1    /* has setreuid(2) call */
  3579.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  3580.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  3581. ! # define HASFLOCK    1    /* has flock(2) call */
  3582.   # define HASGETUSERSHELL 0    /* does not have getusershell(3) call */
  3583.   # ifdef vax
  3584.   #  define LA_TYPE    LA_FLOAT
  3585.   # else
  3586. --- 297,311 ----
  3587.   */
  3588.   
  3589.   #ifdef ultrix
  3590.   # define HASSETREUID    1    /* has setreuid(2) call */
  3591.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  3592.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  3593. ! # define HASUNAME    1    /* use System V uname(2) system call */
  3594. ! # ifndef HASFLOCK
  3595. ! #  define HASFLOCK    1    /* has flock(2) call */
  3596. ! # endif
  3597.   # define HASGETUSERSHELL 0    /* does not have getusershell(3) call */
  3598. + # define BROKEN_RES_SEARCH 1    /* res_search(unknown) returns h_errno=0 */
  3599.   # ifdef vax
  3600.   #  define LA_TYPE    LA_FLOAT
  3601.   # else
  3602. ***************
  3603. *** 295,300 ****
  3604. --- 312,318 ----
  3605.   #  define LA_TYPE    LA_INT
  3606.   #  define LA_AVENRUN    "avenrun"
  3607.   # endif
  3608. + # define SFS_TYPE    SFS_MOUNT    /* use <sys/mount.h> statfs() impl */
  3609.   # ifndef IDENTPROTO
  3610.   #  define IDENTPROTO    0    /* TCP/IP implementation is broken */
  3611.   # endif
  3612. ***************
  3613. *** 306,317 ****
  3614.   */
  3615.   
  3616.   #ifdef __osf__
  3617. - # define HASSTATFS    1    /* has the statfs(2) syscall */
  3618.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  3619.   # define HASSETREUID    1    /* has setreuid(2) call */
  3620.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  3621. ! # define HASFLOCK    1    /* has flock(2) call */
  3622.   # define LA_TYPE    LA_INT
  3623.   # ifndef _PATH_SENDMAILPID
  3624.   #  define _PATH_SENDMAILPID    "/var/run/sendmail.pid"
  3625.   # endif
  3626. --- 324,337 ----
  3627.   */
  3628.   
  3629.   #ifdef __osf__
  3630.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  3631.   # define HASSETREUID    1    /* has setreuid(2) call */
  3632.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  3633. ! # ifndef HASFLOCK
  3634. ! #  define HASFLOCK    1    /* has flock(2) call */
  3635. ! # endif
  3636.   # define LA_TYPE    LA_INT
  3637. + # define SFS_TYPE    SFS_MOUNT    /* use <sys/mount.h> statfs() impl */
  3638.   # ifndef _PATH_SENDMAILPID
  3639.   #  define _PATH_SENDMAILPID    "/var/run/sendmail.pid"
  3640.   # endif
  3641. ***************
  3642. *** 324,332 ****
  3643.   
  3644.   #ifdef NeXT
  3645.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  3646. ! # define HASFLOCK    1    /* has flock(2) call */
  3647.   # define NEEDGETOPT    1    /* need a replacement for getopt(3) */
  3648. - # define HASSTATFS    1    /* has the statfs(2) syscall */
  3649.   # define WAITUNION    1    /* use "union wait" as wait argument type */
  3650.   # define sleep        sleepX
  3651.   # define setpgid    setpgrp
  3652. --- 344,353 ----
  3653.   
  3654.   #ifdef NeXT
  3655.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  3656. ! # ifndef HASFLOCK
  3657. ! #  define HASFLOCK    1    /* has flock(2) call */
  3658. ! # endif
  3659.   # define NEEDGETOPT    1    /* need a replacement for getopt(3) */
  3660.   # define WAITUNION    1    /* use "union wait" as wait argument type */
  3661.   # define sleep        sleepX
  3662.   # define setpgid    setpgrp
  3663. ***************
  3664. *** 333,338 ****
  3665. --- 354,360 ----
  3666.   # ifndef LA_TYPE
  3667.   #  define LA_TYPE    LA_MACH
  3668.   # endif
  3669. + # define SFS_TYPE    SFS_VFS    /* use <sys/vfs.h> statfs() implementation */
  3670.   # ifndef _POSIX_SOURCE
  3671.   typedef int        pid_t;
  3672.   #  undef WEXITSTATUS
  3673. ***************
  3674. *** 355,370 ****
  3675.   
  3676.   #ifdef BSD4_4
  3677.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  3678. - # define HASSTATFS    1    /* has the statfs(2) syscall */
  3679.   # include <sys/cdefs.h>
  3680.   # define ERRLIST_PREDEFINED    /* don't declare sys_errlist */
  3681.   # ifndef LA_TYPE
  3682.   #  define LA_TYPE    LA_SUBR
  3683.   # endif
  3684.   #endif
  3685.   
  3686.   
  3687.   /*
  3688.   **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
  3689.   **
  3690.   **  4.3BSD clone, closer to 4.4BSD
  3691. --- 377,415 ----
  3692.   
  3693.   #ifdef BSD4_4
  3694.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  3695.   # include <sys/cdefs.h>
  3696.   # define ERRLIST_PREDEFINED    /* don't declare sys_errlist */
  3697.   # ifndef LA_TYPE
  3698.   #  define LA_TYPE    LA_SUBR
  3699.   # endif
  3700. + # define SFS_TYPE    SFS_MOUNT    /* use <sys/mount.h> statfs() impl */
  3701.   #endif
  3702.   
  3703.   
  3704.   /*
  3705. + **  BSD/386 (all versions)
  3706. + **    From Tony Sanders, BSDI
  3707. + */
  3708. + #ifdef __bsdi__
  3709. + # define HASUNSETENV    1    /* has the unsetenv(3) call */
  3710. + # define HASSETSID    1    /* has the setsid(2) POSIX syscall */
  3711. + # define SFS_TYPE    SFS_MOUNT    /* use <sys/mount.h> statfs() impl */
  3712. + # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
  3713. + #  define HASSETPROCTITLE 1    /* setproctitle is in libc */
  3714. + # else
  3715. + #  define SETPROCTITLE    1
  3716. + # endif
  3717. + # include <sys/cdefs.h>
  3718. + # define ERRLIST_PREDEFINED    /* don't declare sys_errlist */
  3719. + # ifndef LA_TYPE
  3720. + #  define LA_TYPE    LA_SUBR
  3721. + # endif
  3722. + #endif
  3723. + /*
  3724.   **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
  3725.   **
  3726.   **  4.3BSD clone, closer to 4.4BSD
  3727. ***************
  3728. *** 375,386 ****
  3729.   #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
  3730.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  3731.   # define HASSETSID    1    /* has the setsid(2) POSIX syscall */
  3732. - # define HASSTATFS    1    /* has the statfs(2) syscall */
  3733.   # include <sys/cdefs.h>
  3734.   # define ERRLIST_PREDEFINED    /* don't declare sys_errlist */
  3735.   # ifndef LA_TYPE
  3736.   #  define LA_TYPE    LA_SUBR
  3737.   # endif
  3738.   #endif
  3739.   
  3740.   
  3741. --- 420,431 ----
  3742.   #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
  3743.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  3744.   # define HASSETSID    1    /* has the setsid(2) POSIX syscall */
  3745.   # include <sys/cdefs.h>
  3746.   # define ERRLIST_PREDEFINED    /* don't declare sys_errlist */
  3747.   # ifndef LA_TYPE
  3748.   #  define LA_TYPE    LA_SUBR
  3749.   # endif
  3750. + # define SFS_TYPE    SFS_MOUNT    /* use <sys/mount.h> statfs() impl */
  3751.   #endif
  3752.   
  3753.   
  3754. ***************
  3755. *** 394,401 ****
  3756.   # define MACH386    1
  3757.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  3758.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  3759. ! # define HASFLOCK    1    /* has flock(2) call */
  3760. ! # define HASSTATFS    1    /* has the statfs(2) syscall */
  3761.   # define NEEDGETOPT    1    /* need a replacement for getopt(3) */
  3762.   # define NEEDSTRTOL    1    /* need the strtol() function */
  3763.   # define setpgid    setpgrp
  3764. --- 439,447 ----
  3765.   # define MACH386    1
  3766.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  3767.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  3768. ! # ifndef HASFLOCK
  3769. ! #  define HASFLOCK    1    /* has flock(2) call */
  3770. ! # endif
  3771.   # define NEEDGETOPT    1    /* need a replacement for getopt(3) */
  3772.   # define NEEDSTRTOL    1    /* need the strtol() function */
  3773.   # define setpgid    setpgrp
  3774. ***************
  3775. *** 402,407 ****
  3776. --- 448,454 ----
  3777.   # ifndef LA_TYPE
  3778.   #  define LA_TYPE    LA_FLOAT
  3779.   # endif
  3780. + # define SFS_TYPE    SFS_VFS    /* use <sys/vfs.h> statfs() implementation */
  3781.   # undef HASSETVBUF        /* don't actually have setvbuf(3) */
  3782.   # undef WEXITSTATUS
  3783.   # undef WIFEXITED
  3784. ***************
  3785. *** 417,427 ****
  3786.   /*
  3787.   **  4.3 BSD -- this is for very old systems
  3788.   **
  3789.   **    You'll also have to install a new resolver library.
  3790.   **    I don't guarantee that support for this environment is complete.
  3791.   */
  3792.   
  3793. ! #ifdef oldBSD43
  3794.   # define NEEDVPRINTF    1    /* need a replacement for vprintf(3) */
  3795.   # define NEEDGETOPT    1    /* need a replacement for getopt(3) */
  3796.   # define ARBPTR_T    char *
  3797. --- 464,476 ----
  3798.   /*
  3799.   **  4.3 BSD -- this is for very old systems
  3800.   **
  3801. + **    Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
  3802. + **
  3803.   **    You'll also have to install a new resolver library.
  3804.   **    I don't guarantee that support for this environment is complete.
  3805.   */
  3806.   
  3807. ! #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
  3808.   # define NEEDVPRINTF    1    /* need a replacement for vprintf(3) */
  3809.   # define NEEDGETOPT    1    /* need a replacement for getopt(3) */
  3810.   # define ARBPTR_T    char *
  3811. ***************
  3812. *** 465,475 ****
  3813.   #ifdef _SCO_unix_
  3814.   # define SYSTEM5    1    /* include all the System V defines */
  3815.   # define SYS5SIGNALS    1    /* SysV signal semantics -- reset on each sig */
  3816. - # define HASSTATFS    1    /* has the statfs(2) syscall */
  3817.   # define HASGETUSERSHELL 0    /* does not have getusershell(3) call */
  3818.   # define FORK        fork
  3819.   # define MAXPATHLEN    PATHSIZE
  3820.   # define LA_TYPE    LA_SHORT
  3821.   # undef NETUNIX            /* no unix domain socket support */
  3822.   #endif
  3823.   
  3824. --- 514,524 ----
  3825.   #ifdef _SCO_unix_
  3826.   # define SYSTEM5    1    /* include all the System V defines */
  3827.   # define SYS5SIGNALS    1    /* SysV signal semantics -- reset on each sig */
  3828.   # define HASGETUSERSHELL 0    /* does not have getusershell(3) call */
  3829.   # define FORK        fork
  3830.   # define MAXPATHLEN    PATHSIZE
  3831.   # define LA_TYPE    LA_SHORT
  3832. + # define SFS_TYPE    SFS_STATFS    /* use <sys/statfs.h> statfs() impl */
  3833.   # undef NETUNIX            /* no unix domain socket support */
  3834.   #endif
  3835.   
  3836. ***************
  3837. *** 476,490 ****
  3838.   
  3839.   /*
  3840.   **  ConvexOS 11.0 and later
  3841.   */
  3842.   
  3843.   #ifdef _CONVEX_SOURCE
  3844.   # define BSD        1    /* include all the BSD defines */
  3845.   # define HASUNAME    1    /* use System V uname(2) system call */
  3846. - # define HASSTATFS    1    /* has the statfs(2) syscall */
  3847.   # define HASSETSID    1    /* has POSIX setsid(2) call */
  3848.   # define NEEDGETOPT    1    /* need replacement for getopt(3) */
  3849.   # define LA_TYPE    LA_FLOAT
  3850.   # ifndef IDENTPROTO
  3851.   #  define IDENTPROTO    0    /* TCP/IP implementation is broken */
  3852.   # endif
  3853. --- 525,553 ----
  3854.   
  3855.   /*
  3856.   **  ConvexOS 11.0 and later
  3857. + **
  3858. + **    "Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
  3859. + **    works on 9.1 as well.
  3860.   */
  3861.   
  3862.   #ifdef _CONVEX_SOURCE
  3863.   # define BSD        1    /* include all the BSD defines */
  3864.   # define HASUNAME    1    /* use System V uname(2) system call */
  3865.   # define HASSETSID    1    /* has POSIX setsid(2) call */
  3866.   # define NEEDGETOPT    1    /* need replacement for getopt(3) */
  3867.   # define LA_TYPE    LA_FLOAT
  3868. + # define SFS_TYPE    SFS_VFS    /* use <sys/vfs.h> statfs() implementation */
  3869. + # ifndef _PATH_SENDMAILCF
  3870. + #  define _PATH_SENDMAILCF    "/usr/lib/sendmail.cf"
  3871. + # endif
  3872. + # ifndef S_IREAD
  3873. + #  define S_IREAD    _S_IREAD
  3874. + #  define S_IWRITE    _S_IWRITE
  3875. + #  define S_IEXEC    _S_IEXEC
  3876. + #  define S_IFMT    _S_IFMT
  3877. + #  define S_IFCHR    _S_IFCHR
  3878. + #  define S_IFBLK    _S_IFBLK
  3879. + # endif
  3880.   # ifndef IDENTPROTO
  3881.   #  define IDENTPROTO    0    /* TCP/IP implementation is broken */
  3882.   # endif
  3883. ***************
  3884. *** 500,506 ****
  3885.   #ifdef RISCOS
  3886.   
  3887.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  3888. ! # define HASFLOCK    1    /* has flock(2) call */
  3889.   # define WAITUNION    1    /* use "union wait" as wait argument type */
  3890.   # define NEEDGETOPT    1    /* need a replacement for getopt(3) */
  3891.   # define LA_TYPE    LA_INT
  3892. --- 563,571 ----
  3893.   #ifdef RISCOS
  3894.   
  3895.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  3896. ! # ifndef HASFLOCK
  3897. ! #  define HASFLOCK    1    /* has flock(2) call */
  3898. ! # endif
  3899.   # define WAITUNION    1    /* use "union wait" as wait argument type */
  3900.   # define NEEDGETOPT    1    /* need a replacement for getopt(3) */
  3901.   # define LA_TYPE    LA_INT
  3902. ***************
  3903. *** 522,540 ****
  3904.   
  3905.   /*
  3906.   **  Linux 0.99pl10 and above...
  3907. ! **    From Karl London <karl@borg.demon.co.uk>.
  3908.   */
  3909.   
  3910.   #ifdef __linux__
  3911. ! # define BSD        1    /* pretend to be BSD based today */
  3912. ! # undef  NEEDVPRINTF    1    /* need a replacement for vprintf(3) */
  3913.   # define NEEDGETOPT    1    /* need a replacement for getopt(3) */
  3914.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  3915.   # ifndef LA_TYPE
  3916. ! #  define LA_TYPE    LA_FLOAT
  3917.   # endif
  3918.   # include <sys/sysmacros.h>
  3919. ! # define GIDSET_T    gid_t
  3920.   #endif
  3921.   
  3922.   
  3923. --- 587,618 ----
  3924.   
  3925.   /*
  3926.   **  Linux 0.99pl10 and above...
  3927. ! **
  3928. ! **  Thanks to, in reverse order of contact:
  3929. ! **
  3930. ! **    John Kennedy <warlock@csuchico.edu>
  3931. ! **    Florian La Roche <rzsfl@rz.uni-sb.de>
  3932. ! **    Karl London <karl@borg.demon.co.uk>
  3933. ! **
  3934. ! **  Last compiled against:    [03/02/94 @ 05:34 PM (Wednesday)]
  3935. ! **    sendmail 8.6.6.b9    named 4.9.2-931205-p1    db-1.73
  3936. ! **    gcc 2.5.8        libc.so.4.5.19
  3937. ! **    slackware 1.1.2        linux 0.99.15
  3938.   */
  3939.   
  3940.   #ifdef __linux__
  3941. ! # define BSD        1    /* include BSD defines */
  3942.   # define NEEDGETOPT    1    /* need a replacement for getopt(3) */
  3943. + # define HASUNAME    1    /* use System V uname(2) system call */
  3944.   # define HASUNSETENV    1    /* has unsetenv(3) call */
  3945. + # define ERRLIST_PREDEFINED    /* don't declare sys_errlist */
  3946. + # define GIDSET_T    gid_t    /* from <linux/types.h> */
  3947.   # ifndef LA_TYPE
  3948. ! #  define LA_TYPE    LA_PROCSTR
  3949.   # endif
  3950. + # define SFS_TYPE    SFS_VFS        /* use <sys/vfs.h> statfs() impl */
  3951.   # include <sys/sysmacros.h>
  3952. ! # undef atol            /* wounded in <stdlib.h> */
  3953.   #endif
  3954.   
  3955.   
  3956. ***************
  3957. *** 563,571 ****
  3958.   #ifdef _AUX_SOURCE
  3959.   # include <sys/sysmacros.h>
  3960.   # define BSD            /* has BSD routines */
  3961. - # define HASSTATFS    1    /* has the statfs(2) syscall */
  3962.   # define HASUNAME    1    /* use System V uname(2) system call */
  3963. - # define HASUSTAT    1    /* use System V ustat(2) syscall */
  3964.   # define HASSETVBUF    1    /* we have setvbuf(3) in libc */
  3965.   # define SIGFUNC_DEFINED    /* sigfunc_t already defined */
  3966.   # ifndef IDENTPROTO
  3967. --- 641,647 ----
  3968. ***************
  3969. *** 578,583 ****
  3970. --- 654,660 ----
  3971.   # ifndef LA_TYPE
  3972.   #  define LA_TYPE    LA_ZERO
  3973.   # endif
  3974. + # define SFS_TYPE    SFS_VFS    /* use <sys/vfs.h> statfs() implementation */
  3975.   # undef WIFEXITED
  3976.   # undef WEXITSTATUS
  3977.   #endif
  3978. ***************
  3979. *** 592,598 ****
  3980.   #ifdef UMAXV
  3981.   # include <limits.h>
  3982.   # define HASUNAME    1    /* use System V uname(2) system call */
  3983. - # define HASSTATFS    1    /* has the statfs(2) syscall */
  3984.   # define HASSETVBUF    1    /* we have setvbuf(3) in libc */
  3985.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  3986.   # define HASGETUSERSHELL 0    /* does not have getusershell(3) call */
  3987. --- 669,674 ----
  3988. ***************
  3989. *** 599,604 ****
  3990. --- 675,681 ----
  3991.   # define SYS5SIGNALS    1    /* SysV signal semantics -- reset on each sig */
  3992.   # define SYS5SETPGRP    1    /* use System V setpgrp(2) syscall */
  3993.   # define FORK        fork    /* no vfork(2) primitive available */
  3994. + # define SFS_TYPE    SFS_4ARGS    /* four argument statfs() call */
  3995.   # define MAXPATHLEN    PATH_MAX
  3996.   extern struct passwd    *getpwent(), *getpwnam(), *getpwuid();
  3997.   extern struct group    *getgrent(), *getgrnam(), *getgrgid();
  3998. ***************
  3999. *** 632,637 ****
  4000. --- 709,715 ----
  4001.   */
  4002.   
  4003.   #ifdef sequent
  4004.   # define BSD        1
  4005.   # define HASUNSETENV    1
  4006.   # define BSD4_3        1    /* to get signal() in conf.c */
  4007. ***************
  4008. *** 651,656 ****
  4009. --- 729,738 ----
  4010.   typedef int        pid_t;
  4011.   # define isgraph(c)    (isprint(c) && (c != ' '))
  4012.   
  4013. + # ifndef IDENTPROTO
  4014. + #  define IDENTPROTO    0    /* TCP/IP implementation is broken */
  4015. + # endif
  4016.   # ifndef _PATH_UNIX
  4017.   #  define _PATH_UNIX    "/dynix"
  4018.   # endif
  4019. ***************
  4020. *** 661,668 ****
  4021. --- 743,825 ----
  4022.   #endif
  4023.   
  4024.   
  4025. + /*
  4026. + **  Sequent DYNIX/ptx v2.0 (and higher)
  4027. + **
  4028. + **    For DYNIX/ptx v1.x, undefine HASSETREUID.
  4029. + **
  4030. + **    From Tim Wright <timw@sequent.com>.
  4031. + */
  4032.   
  4033. + #ifdef _SEQUENT_
  4034. + # define SYSTEM5    1    /* include all the System V defines */
  4035. + # define HASSETSID    1    /* has POSIX setsid(2) call */
  4036. + # define HASINITGROUPS    1    /* has initgroups(3) call */
  4037. + # define HASSETREUID    1    /* has setreuid(2) call */
  4038. + # define HASGETUSERSHELL 0    /* does not have getusershell(3) call */
  4039. + # define GIDSET_T    gid_t
  4040. + # define LA_TYPE    LA_INT
  4041. + # define SFS_TYPE    SFS_STATFS    /* use <sys/statfs.h> statfs() impl */
  4042. + # undef SETPROCTITLE
  4043. + # ifndef IDENTPROTO
  4044. + #  define IDENTPROTO    0    /* TCP/IP implementation is broken */
  4045. + # endif
  4046. + # ifndef _PATH_SENDMAILCF
  4047. + #  define _PATH_SENDMAILCF    "/usr/lib/sendmail.cf"
  4048. + # endif
  4049. + # ifndef _PATH_SENDMAILPID
  4050. + #  define _PATH_SENDMAILPID    "/etc/sendmail.pid"
  4051. + # endif
  4052. + #endif
  4053.   
  4054. + /*
  4055. + **  Cray Unicos
  4056. + **
  4057. + **    Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
  4058. + */
  4059. + #ifdef UNICOS
  4060. + # define SYSTEM5    1    /* include all the System V defines */
  4061. + # define SYS5SIGNALS    1    /* SysV signal semantics -- reset on each sig */
  4062. + # define MAXPATHLEN    PATHSIZE
  4063. + # define LA_TYPE    LA_ZERO
  4064. + # define SFS_TYPE    SFS_4ARGS    /* four argument statfs() call */
  4065. + #endif
  4066. + /*
  4067. + **  Apollo DomainOS
  4068. + **
  4069. + **  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
  4070. + **
  4071. + **  15 Jan 1994
  4072. + **
  4073. + */
  4074. + #ifdef apollo
  4075. + # define HASSETREUID    1    /* has setreuid(2) call */
  4076. + # define HASINITGROUPS    1    /* has initgroups(2) call */
  4077. + # undef  SETPROCTITLE
  4078. + # define LA_TYPE    LA_SUBR        /* use getloadavg.c */
  4079. + # define SFS_TYPE    SFS_4ARGS    /* four argument statfs() call */
  4080. + # ifndef _PATH_SENDMAILCF
  4081. + #  define _PATH_SENDMAILCF    "/usr/lib/sendmail.cf"
  4082. + # endif
  4083. + # ifndef _PATH_SENDMAILPID
  4084. + #  define _PATH_SENDMAILPID    "/etc/sendmail.pid"
  4085. + # endif
  4086. + # undef  S_IFSOCK        /* S_IFSOCK and S_IFIFO are the same */
  4087. + # undef  S_IFIFO
  4088. + # define S_IFIFO    0010000
  4089. + # ifndef IDENTPROTO
  4090. + #  define IDENTPROTO    0    /* TCP/IP implementation is broken */
  4091. + # endif
  4092. + #endif
  4093.   /**********************************************************************
  4094.   **  End of Per-Operating System defines
  4095.   **********************************************************************/
  4096. ***************
  4097. *** 676,682 ****
  4098.   # define HASGETDTABLESIZE 1    /* has getdtablesize(2) call */
  4099.   # define HASSETREUID    1    /* has setreuid(2) call */
  4100.   # define HASINITGROUPS    1    /* has initgroups(2) call */
  4101. ! # define HASFLOCK    1    /* has flock(2) call */
  4102.   #endif
  4103.   
  4104.   /* general System V Release 4 defines */
  4105. --- 833,841 ----
  4106.   # define HASGETDTABLESIZE 1    /* has getdtablesize(2) call */
  4107.   # define HASSETREUID    1    /* has setreuid(2) call */
  4108.   # define HASINITGROUPS    1    /* has initgroups(2) call */
  4109. ! # ifndef HASFLOCK
  4110. ! #  define HASFLOCK    1    /* has flock(2) call */
  4111. ! # endif
  4112.   #endif
  4113.   
  4114.   /* general System V Release 4 defines */
  4115. ***************
  4116. *** 703,721 ****
  4117.   #endif
  4118.   
  4119.   /* general System V defines */
  4120. ! # ifdef SYSTEM5
  4121.   # include <sys/sysmacros.h>
  4122.   # define HASUNAME    1    /* use System V uname(2) system call */
  4123. - # define HASUSTAT    1    /* use System V ustat(2) syscall */
  4124.   # define SYS5SETPGRP    1    /* use System V setpgrp(2) syscall */
  4125.   # define HASSETVBUF    1    /* we have setvbuf(3) in libc */
  4126.   # ifndef LA_TYPE
  4127. ! #  define LA_TYPE    LA_INT
  4128.   # endif
  4129.   # define bcopy(s, d, l)        (memmove((d), (s), (l)))
  4130.   # define bzero(d, l)        (memset((d), '\0', (l)))
  4131.   # define bcmp(s, d, l)        (memcmp((s), (d), (l)))
  4132. ! # endif
  4133.   
  4134.   /* general POSIX defines */
  4135.   #ifdef _POSIX_VERSION
  4136. --- 862,882 ----
  4137.   #endif
  4138.   
  4139.   /* general System V defines */
  4140. ! #ifdef SYSTEM5
  4141.   # include <sys/sysmacros.h>
  4142.   # define HASUNAME    1    /* use System V uname(2) system call */
  4143.   # define SYS5SETPGRP    1    /* use System V setpgrp(2) syscall */
  4144.   # define HASSETVBUF    1    /* we have setvbuf(3) in libc */
  4145.   # ifndef LA_TYPE
  4146. ! #  define LA_TYPE    LA_INT        /* assume integer load average */
  4147.   # endif
  4148. + # ifndef SFS_TYPE
  4149. + #  define SFS_TYPE    SFS_USTAT    /* use System V ustat(2) syscall */
  4150. + # endif
  4151.   # define bcopy(s, d, l)        (memmove((d), (s), (l)))
  4152.   # define bzero(d, l)        (memset((d), '\0', (l)))
  4153.   # define bcmp(s, d, l)        (memcmp((s), (d), (l)))
  4154. ! #endif
  4155.   
  4156.   /* general POSIX defines */
  4157.   #ifdef _POSIX_VERSION
  4158. ***************
  4159. *** 742,747 ****
  4160. --- 903,909 ----
  4161.   # undef HASINITGROUPS        /* doesn't have initgroups(3) call */
  4162.   #endif
  4163.   
  4164.   /*
  4165.   **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
  4166.   **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
  4167. ***************
  4168. *** 761,767 ****
  4169. --- 923,933 ----
  4170.   # define HASGETUSERSHELL 1    /* libc has getusershell(3) call */
  4171.   #endif
  4172.   
  4173. + #ifndef HASFLOCK
  4174. + # define HASFLOCK    0    /* assume no flock(2) support */
  4175. + #endif
  4176.   
  4177.   /**********************************************************************
  4178.   **  Remaining definitions should never have to be changed.  They are
  4179.   **  primarily to provide back compatibility for older systems -- for
  4180. ***************
  4181. *** 935,937 ****
  4182. --- 1101,1111 ----
  4183.   # ifndef FORK
  4184.   # define FORK        vfork        /* function to call to fork mailer */
  4185.   # endif
  4186. + /*
  4187. + **  If we are going to link scanf anyway, use it in readcf
  4188. + */
  4189. + #if !defined(HASUNAME) && !defined(SCANF)
  4190. + # define SCANF        1
  4191. + #endif
  4192. *** src/daemon.c.OLD    Sat Jan  8 17:29:32 1994
  4193. --- src/daemon.c    Sun Mar 13 09:21:18 1994
  4194. ***************
  4195. *** 37,45 ****
  4196.   
  4197.   #ifndef lint
  4198.   #ifdef DAEMON
  4199. ! static char sccsid[] = "@(#)daemon.c    8.30 (Berkeley) 1/8/94 (with daemon mode)";
  4200.   #else
  4201. ! static char sccsid[] = "@(#)daemon.c    8.30 (Berkeley) 1/8/94 (without daemon mode)";
  4202.   #endif
  4203.   #endif /* not lint */
  4204.   
  4205. --- 37,45 ----
  4206.   
  4207.   #ifndef lint
  4208.   #ifdef DAEMON
  4209. ! static char sccsid[] = "@(#)daemon.c    8.39 (Berkeley) 3/13/94 (with daemon mode)";
  4210.   #else
  4211. ! static char sccsid[] = "@(#)daemon.c    8.39 (Berkeley) 3/13/94 (without daemon mode)";
  4212.   #endif
  4213.   #endif /* not lint */
  4214.   
  4215. ***************
  4216. *** 46,55 ****
  4217.   #ifdef DAEMON
  4218.   
  4219.   # include <netdb.h>
  4220. - # include <sys/time.h>
  4221.   # include <arpa/inet.h>
  4222.   
  4223. ! #ifdef NAMED_BIND
  4224.   # include <arpa/nameser.h>
  4225.   # include <resolv.h>
  4226.   #endif
  4227. --- 46,54 ----
  4228.   #ifdef DAEMON
  4229.   
  4230.   # include <netdb.h>
  4231.   # include <arpa/inet.h>
  4232.   
  4233. ! #if NAMED_BIND
  4234.   # include <arpa/nameser.h>
  4235.   # include <resolv.h>
  4236.   #endif
  4237. ***************
  4238. *** 302,311 ****
  4239. --- 301,315 ----
  4240.               */
  4241.   
  4242.               (void) setsignal(SIGCHLD, SIG_DFL);
  4243. +             DisConnected = FALSE;
  4244.   
  4245. +             setproctitle("startup with %s",
  4246. +                 anynet_ntoa(&RealHostAddr));
  4247.               /* determine host name */
  4248.               p = hostnamebyanyaddr(&RealHostAddr);
  4249.               RealHostName = newstr(p);
  4250. +             setproctitle("startup with %s", p);
  4251.   
  4252.   #ifdef LOG
  4253.               if (LogLevel > 11)
  4254. ***************
  4255. *** 545,551 ****
  4256.       SOCKADDR addr;
  4257.       int sav_errno;
  4258.       int addrlen;
  4259. ! #ifdef NAMED_BIND
  4260.       extern int h_errno;
  4261.   #endif
  4262.   
  4263. --- 549,555 ----
  4264.       SOCKADDR addr;
  4265.       int sav_errno;
  4266.       int addrlen;
  4267. ! #if NAMED_BIND
  4268.       extern int h_errno;
  4269.   #endif
  4270.   
  4271. ***************
  4272. *** 554,560 ****
  4273.       **    Accept "[a.b.c.d]" syntax for host name.
  4274.       */
  4275.   
  4276. ! #ifdef NAMED_BIND
  4277.       h_errno = 0;
  4278.   #endif
  4279.       errno = 0;
  4280. --- 558,564 ----
  4281.       **    Accept "[a.b.c.d]" syntax for host name.
  4282.       */
  4283.   
  4284. ! #if NAMED_BIND
  4285.       h_errno = 0;
  4286.   #endif
  4287.       errno = 0;
  4288. ***************
  4289. *** 577,582 ****
  4290. --- 581,592 ----
  4291.               {
  4292.                   /* try it as a host name (avoid MX lookup) */
  4293.                   hp = gethostbyname(&host[1]);
  4294. +                 if (hp == NULL && p[-1] == '.')
  4295. +                 {
  4296. +                     p[-1] = '\0';
  4297. +                     hp = gethostbyname(&host[1]);
  4298. +                     p[-1] = '.';
  4299. +                 }
  4300.                   *p = ']';
  4301.                   goto gothostent;
  4302.               }
  4303. ***************
  4304. *** 594,604 ****
  4305.       }
  4306.       else
  4307.       {
  4308.           hp = gethostbyname(host);
  4309.   gothostent:
  4310.           if (hp == NULL)
  4311.           {
  4312. ! #ifdef NAMED_BIND
  4313.               if (errno == ETIMEDOUT || h_errno == TRY_AGAIN)
  4314.                   return (EX_TEMPFAIL);
  4315.   
  4316. --- 604,622 ----
  4317.       }
  4318.       else
  4319.       {
  4320. +         register char *p = &host[strlen(host) - 1];
  4321.           hp = gethostbyname(host);
  4322. +         if (hp == NULL && *p == '.')
  4323. +         {
  4324. +             *p = '\0';
  4325. +             hp = gethostbyname(host);
  4326. +             *p = '.';
  4327. +         }
  4328.   gothostent:
  4329.           if (hp == NULL)
  4330.           {
  4331. ! #if NAMED_BIND
  4332.               if (errno == ETIMEDOUT || h_errno == TRY_AGAIN)
  4333.                   return (EX_TEMPFAIL);
  4334.   
  4335. ***************
  4336. *** 844,852 ****
  4337.   **
  4338.   **    Returns:
  4339.   **        The user@host information associated with this descriptor.
  4340. - **
  4341. - **    Side Effects:
  4342. - **        Sets RealHostName to the name of the host at the other end.
  4343.   */
  4344.   
  4345.   #if IDENTPROTO
  4346. --- 862,867 ----
  4347. ***************
  4348. *** 884,890 ****
  4349.       if (getpeername(fd, &fa.sa, &falen) < 0 || falen <= 0 ||
  4350.           fa.sa.sa_family == 0)
  4351.       {
  4352. -         RealHostName = "localhost";
  4353.           (void) sprintf(hbuf, "%s@localhost", RealUserName);
  4354.           if (tTd(9, 1))
  4355.               printf("getauthinfo: %s\n", hbuf);
  4356. --- 899,904 ----
  4357. ***************
  4358. *** 891,901 ****
  4359.           return hbuf;
  4360.       }
  4361.   
  4362. -     p = hostnamebyanyaddr(&fa);
  4363. -     RealHostName = newstr(p);
  4364. -     RealHostAddr = fa;
  4365.   #if IDENTPROTO
  4366.       lalen = sizeof la;
  4367.       if (fa.sa.sa_family != AF_INET ||
  4368.           getsockname(fd, &la.sa, &lalen) < 0 || lalen <= 0 ||
  4369. --- 905,914 ----
  4370.           return hbuf;
  4371.       }
  4372.   
  4373.   #if IDENTPROTO
  4374. +     if (TimeOuts.to_ident == 0)
  4375. +         goto noident;
  4376.       lalen = sizeof la;
  4377.       if (fa.sa.sa_family != AF_INET ||
  4378.           getsockname(fd, &la.sa, &lalen) < 0 || lalen <= 0 ||
  4379. ***************
  4380. *** 940,949 ****
  4381.       if (bind(s, &la.sa, sizeof la.sin) < 0 ||
  4382.           connect(s, &fa.sa, sizeof fa.sin) < 0)
  4383.       {
  4384. ! closeident:
  4385. !         (void) close(s);
  4386. !         clrevent(ev);
  4387. !         goto noident;
  4388.       }
  4389.   
  4390.       if (tTd(9, 10))
  4391. --- 953,959 ----
  4392.       if (bind(s, &la.sa, sizeof la.sin) < 0 ||
  4393.           connect(s, &fa.sa, sizeof fa.sin) < 0)
  4394.       {
  4395. !         goto closeident;
  4396.       }
  4397.   
  4398.       if (tTd(9, 10))
  4399. ***************
  4400. *** 1002,1017 ****
  4401.           continue;
  4402.   
  4403.       /* p now points to the authenticated name */
  4404. !     (void) sprintf(hbuf, "%s@%s", p, RealHostName);
  4405.       goto finish;
  4406.   
  4407.   #endif /* IDENTPROTO */
  4408.   
  4409.   noident:
  4410.       (void) strcpy(hbuf, RealHostName);
  4411.   
  4412.   finish:
  4413. !     if (RealHostName[0] != '[')
  4414.       {
  4415.           p = &hbuf[strlen(hbuf)];
  4416.           (void) sprintf(p, " [%s]", anynet_ntoa(&RealHostAddr));
  4417. --- 1012,1038 ----
  4418.           continue;
  4419.   
  4420.       /* p now points to the authenticated name */
  4421. !     (void) sprintf(hbuf, "%s@%s",
  4422. !         p, RealHostName == NULL ? "localhost" : RealHostName);
  4423.       goto finish;
  4424.   
  4425. + closeident:
  4426. +     (void) close(s);
  4427. +     clrevent(ev);
  4428.   #endif /* IDENTPROTO */
  4429.   
  4430.   noident:
  4431. +     if (RealHostName == NULL)
  4432. +     {
  4433. +         if (tTd(9, 1))
  4434. +             printf("getauthinfo: NULL\n");
  4435. +         return NULL;
  4436. +     }
  4437.       (void) strcpy(hbuf, RealHostName);
  4438.   
  4439.   finish:
  4440. !     if (RealHostName != NULL && RealHostName[0] != '[')
  4441.       {
  4442.           p = &hbuf[strlen(hbuf)];
  4443.           (void) sprintf(p, " [%s]", anynet_ntoa(&RealHostAddr));
  4444. ***************
  4445. *** 1055,1061 ****
  4446. --- 1076,1084 ----
  4447.       register STAB *s;
  4448.       char hbuf[MAXNAME];
  4449.       extern struct hostent *gethostbyaddr();
  4450. + #if NAMED_BIND
  4451.       extern int h_errno;
  4452. + #endif
  4453.   
  4454.       /*
  4455.       **  See if we have already looked up this name.  If so, just
  4456. ***************
  4457. *** 1069,1075 ****
  4458. --- 1092,1100 ----
  4459.               printf("host_map_lookup(%s) => CACHE %s\n",
  4460.                   name, s->s_namecanon.nc_cname);
  4461.           errno = s->s_namecanon.nc_errno;
  4462. + #if NAMED_BIND
  4463.           h_errno = s->s_namecanon.nc_herrno;
  4464. + #endif
  4465.           *statp = s->s_namecanon.nc_stat;
  4466.           if (CurEnv->e_message == NULL && *statp == EX_TEMPFAIL)
  4467.           {
  4468. ***************
  4469. *** 1107,1116 ****
  4470.           {
  4471.               register struct hostent *hp;
  4472.   
  4473. -             if (tTd(9, 1))
  4474. -                 printf("FAIL (%d)\n", h_errno);
  4475.               s->s_namecanon.nc_errno = errno;
  4476.               s->s_namecanon.nc_herrno = h_errno;
  4477.               switch (h_errno)
  4478.               {
  4479.                 case TRY_AGAIN:
  4480. --- 1132,1142 ----
  4481.           {
  4482.               register struct hostent *hp;
  4483.   
  4484.               s->s_namecanon.nc_errno = errno;
  4485. + #if NAMED_BIND
  4486.               s->s_namecanon.nc_herrno = h_errno;
  4487. +             if (tTd(9, 1))
  4488. +                 printf("FAIL (%d)\n", h_errno);
  4489.               switch (h_errno)
  4490.               {
  4491.                 case TRY_AGAIN:
  4492. ***************
  4493. *** 1137,1142 ****
  4494. --- 1163,1173 ----
  4495.                   *statp = EX_UNAVAILABLE;
  4496.                   break;
  4497.               }
  4498. + #else
  4499. +             if (tTd(9, 1))
  4500. +                 printf("FAIL\n");
  4501. +             *statp = EX_NOHOST;
  4502. + #endif
  4503.               s->s_namecanon.nc_stat = *statp;
  4504.               if (*statp != EX_TEMPFAIL || UseNameServer)
  4505.                   return NULL;
  4506. ***************
  4507. *** 1167,1173 ****
  4508. --- 1198,1206 ----
  4509.       /* nope -- ask the name server */
  4510.       hp = gethostbyaddr((char *)&in_addr, sizeof(struct in_addr), AF_INET);
  4511.       s->s_namecanon.nc_errno = errno;
  4512. + #if NAMED_BIND
  4513.       s->s_namecanon.nc_herrno = h_errno;
  4514. + #endif
  4515.       s->s_namecanon.nc_flags |= NCF_VALID;        /* will be soon */
  4516.       if (hp == NULL)
  4517.       {
  4518. ***************
  4519. *** 1261,1267 ****
  4520.       register struct hostent *hp;
  4521.       int saveretry;
  4522.   
  4523. ! #ifdef NAMED_BIND
  4524.       /* shorten name server timeout to avoid higher level timeouts */
  4525.       saveretry = _res.retry;
  4526.       _res.retry = 3;
  4527. --- 1294,1300 ----
  4528.       register struct hostent *hp;
  4529.       int saveretry;
  4530.   
  4531. ! #if NAMED_BIND
  4532.       /* shorten name server timeout to avoid higher level timeouts */
  4533.       saveretry = _res.retry;
  4534.       _res.retry = 3;
  4535. ***************
  4536. *** 1298,1304 ****
  4537.           break;
  4538.       }
  4539.   
  4540. ! #ifdef NAMED_BIND
  4541.       _res.retry = saveretry;
  4542.   #endif /* NAMED_BIND */
  4543.   
  4544. --- 1331,1337 ----
  4545.           break;
  4546.       }
  4547.   
  4548. ! #if NAMED_BIND
  4549.       _res.retry = saveretry;
  4550.   #endif /* NAMED_BIND */
  4551.   
  4552. *** src/deliver.c.OLD    Wed Jan 12 12:38:48 1994
  4553. --- src/deliver.c    Fri Mar 11 14:42:23 1994
  4554. ***************
  4555. *** 33,45 ****
  4556.    */
  4557.   
  4558.   #ifndef lint
  4559. ! static char sccsid[] = "@(#)deliver.c    8.62 (Berkeley) 1/12/94";
  4560.   #endif /* not lint */
  4561.   
  4562.   #include "sendmail.h"
  4563.   #include <netdb.h>
  4564.   #include <errno.h>
  4565. ! #ifdef NAMED_BIND
  4566.   #include <arpa/nameser.h>
  4567.   #include <resolv.h>
  4568.   
  4569. --- 33,45 ----
  4570.    */
  4571.   
  4572.   #ifndef lint
  4573. ! static char sccsid[] = "@(#)deliver.c    8.78 (Berkeley) 3/11/94";
  4574.   #endif /* not lint */
  4575.   
  4576.   #include "sendmail.h"
  4577.   #include <netdb.h>
  4578.   #include <errno.h>
  4579. ! #if NAMED_BIND
  4580.   #include <arpa/nameser.h>
  4581.   #include <resolv.h>
  4582.   
  4583. ***************
  4584. *** 124,132 ****
  4585.       if (e->e_hopcount > MaxHopCount)
  4586.       {
  4587.           errno = 0;
  4588.           syserr("554 too many hops %d (%d max): from %s via %s, to %s",
  4589.               e->e_hopcount, MaxHopCount, e->e_from.q_paddr,
  4590. !             RealHostName, e->e_sendqueue->q_paddr);
  4591.           return;
  4592.       }
  4593.   
  4594. --- 124,134 ----
  4595.       if (e->e_hopcount > MaxHopCount)
  4596.       {
  4597.           errno = 0;
  4598. +         e->e_flags |= EF_FATALERRS|EF_PM_NOTIFY|EF_CLRQUEUE;
  4599.           syserr("554 too many hops %d (%d max): from %s via %s, to %s",
  4600.               e->e_hopcount, MaxHopCount, e->e_from.q_paddr,
  4601. !             RealHostName == NULL ? "localhost" : RealHostName,
  4602. !             e->e_sendqueue->q_paddr);
  4603.           return;
  4604.       }
  4605.   
  4606. ***************
  4607. *** 247,256 ****
  4608. --- 249,264 ----
  4609.               
  4610.               for (q = e->e_sendqueue; q != NULL; q = q->q_next)
  4611.                   if (q->q_owner == owner)
  4612. +                 {
  4613.                       q->q_flags |= QDONTSEND;
  4614. +                     q->q_flags &= ~QQUEUEUP;
  4615. +                 }
  4616.               for (q = ee->e_sendqueue; q != NULL; q = q->q_next)
  4617.                   if (q->q_owner != owner)
  4618. +                 {
  4619.                       q->q_flags |= QDONTSEND;
  4620. +                     q->q_flags &= ~QQUEUEUP;
  4621. +                 }
  4622.   
  4623.               if (e->e_df != NULL && mode != SM_VERIFY)
  4624.               {
  4625. ***************
  4626. *** 263,275 ****
  4627.                           e->e_df, ee->e_df);
  4628.                   }
  4629.               }
  4630. -             if (mode != SM_VERIFY)
  4631. -                 openxscript(ee);
  4632.   #ifdef LOG
  4633.               if (LogLevel > 4)
  4634. !                 syslog(LOG_INFO, "%s: clone %s",
  4635. !                     ee->e_id, e->e_id);
  4636.   #endif
  4637.           }
  4638.       }
  4639. --- 271,280 ----
  4640.                           e->e_df, ee->e_df);
  4641.                   }
  4642.               }
  4643.   #ifdef LOG
  4644.               if (LogLevel > 4)
  4645. !                 syslog(LOG_INFO, "%s: clone %s, owner=%s",
  4646. !                     ee->e_id, e->e_id, owner);
  4647.   #endif
  4648.           }
  4649.       }
  4650. ***************
  4651. *** 309,323 ****
  4652.           for (ee = splitenv; ee != NULL; ee = ee->e_sibling)
  4653.           {
  4654.               CurEnv = ee;
  4655.               sendenvelope(ee, mode);
  4656.           }
  4657.   
  4658.           CurEnv = e;
  4659.       }
  4660.       sendenvelope(e, mode);
  4661. -     for (; splitenv != NULL; splitenv = splitenv->e_sibling)
  4662. -         dropenvelope(splitenv);
  4663.   }
  4664.   
  4665.   sendenvelope(e, mode)
  4666. --- 314,328 ----
  4667.           for (ee = splitenv; ee != NULL; ee = ee->e_sibling)
  4668.           {
  4669.               CurEnv = ee;
  4670. +             if (mode != SM_VERIFY)
  4671. +                 openxscript(ee);
  4672.               sendenvelope(ee, mode);
  4673. +             dropenvelope(ee);
  4674.           }
  4675.   
  4676.           CurEnv = e;
  4677.       }
  4678.       sendenvelope(e, mode);
  4679.   }
  4680.   
  4681.   sendenvelope(e, mode)
  4682. ***************
  4683. *** 360,366 ****
  4684.           if (e->e_xfp != NULL)
  4685.               (void) fflush(e->e_xfp);
  4686.   
  4687. ! # ifndef HASFLOCK
  4688.           /*
  4689.           **  Since fcntl locking has the interesting semantic that
  4690.           **  the lock is owned by a process, not by an open file
  4691. --- 365,371 ----
  4692.           if (e->e_xfp != NULL)
  4693.               (void) fflush(e->e_xfp);
  4694.   
  4695. ! # if !HASFLOCK
  4696.           /*
  4697.           **  Since fcntl locking has the interesting semantic that
  4698.           **  the lock is owned by a process, not by an open file
  4699. ***************
  4700. *** 401,416 ****
  4701.                   (void) xfclose(e->e_dfp, "sendenvelope", e->e_df);
  4702.               e->e_dfp = NULL;
  4703.               e->e_id = e->e_df = NULL;
  4704.               return;
  4705.           }
  4706.   
  4707.           /* double fork to avoid zombies */
  4708. !         if (fork() > 0)
  4709.               exit(EX_OK);
  4710.   
  4711.           /* be sure we are immune from the terminal */
  4712.           disconnect(1, e);
  4713.   
  4714.           /*
  4715.           **  Close any cached connections.
  4716.           **
  4717. --- 406,432 ----
  4718.                   (void) xfclose(e->e_dfp, "sendenvelope", e->e_df);
  4719.               e->e_dfp = NULL;
  4720.               e->e_id = e->e_df = NULL;
  4721. +             /* catch intermediate zombie */
  4722. +             (void) waitfor(pid);
  4723.               return;
  4724.           }
  4725.   
  4726.           /* double fork to avoid zombies */
  4727. !         pid = fork();
  4728. !         if (pid > 0)
  4729.               exit(EX_OK);
  4730.   
  4731.           /* be sure we are immune from the terminal */
  4732.           disconnect(1, e);
  4733.   
  4734. +         /* prevent parent from waiting if there was an error */
  4735. +         if (pid < 0)
  4736. +         {
  4737. +             e->e_flags |= EF_INQUEUE|EF_KEEPQUEUE;
  4738. +             finis();
  4739. +         }
  4740.           /*
  4741.           **  Close any cached connections.
  4742.           **
  4743. ***************
  4744. *** 604,610 ****
  4745.       if (bitset(QDONTSEND|QBADADDR|QQUEUEUP, to->q_flags))
  4746.           return (0);
  4747.   
  4748. ! #ifdef NAMED_BIND
  4749.       /* unless interactive, try twice, over a minute */
  4750.       if (OpMode == MD_DAEMON || OpMode == MD_SMTP)
  4751.       {
  4752. --- 620,626 ----
  4753.       if (bitset(QDONTSEND|QBADADDR|QQUEUEUP, to->q_flags))
  4754.           return (0);
  4755.   
  4756. ! #if NAMED_BIND
  4757.       /* unless interactive, try twice, over a minute */
  4758.       if (OpMode == MD_DAEMON || OpMode == MD_SMTP)
  4759.       {
  4760. ***************
  4761. *** 620,627 ****
  4762.       SmtpError[0] = '\0';
  4763.   
  4764.       if (tTd(10, 1))
  4765. !         printf("\n--deliver, mailer=%d, host=`%s', first user=`%s'\n",
  4766. !             m->m_mno, host, to->q_user);
  4767.       if (tTd(10, 100))
  4768.           printopenfds(FALSE);
  4769.   
  4770. --- 636,643 ----
  4771.       SmtpError[0] = '\0';
  4772.   
  4773.       if (tTd(10, 1))
  4774. !         printf("\n--deliver, id=%s, mailer=%s, host=`%s', first user=`%s'\n",
  4775. !             e->e_id, m->m_name, host, to->q_user);
  4776.       if (tTd(10, 100))
  4777.           printopenfds(FALSE);
  4778.   
  4779. ***************
  4780. *** 916,925 ****
  4781.       */
  4782.   
  4783.       /*XXX this seems a bit wierd */
  4784. !     if (ctladdr == NULL && bitset(QGOODUID, e->e_from.q_flags))
  4785.           ctladdr = &e->e_from;
  4786.   
  4787. ! #ifdef NAMED_BIND
  4788.       if (ConfigLevel < 2)
  4789.           _res.options &= ~(RES_DEFNAMES | RES_DNSRCH);    /* XXX */
  4790.   #endif
  4791. --- 932,942 ----
  4792.       */
  4793.   
  4794.       /*XXX this seems a bit wierd */
  4795. !     if (ctladdr == NULL && m != ProgMailer &&
  4796. !         bitset(QGOODUID, e->e_from.q_flags))
  4797.           ctladdr = &e->e_from;
  4798.   
  4799. ! #if NAMED_BIND
  4800.       if (ConfigLevel < 2)
  4801.           _res.options &= ~(RES_DEFNAMES | RES_DNSRCH);    /* XXX */
  4802.   #endif
  4803. ***************
  4804. *** 1047,1053 ****
  4805.                   bitnset(M_SECURE_PORT, m->m_flags));
  4806.               mci->mci_exitstat = i;
  4807.               mci->mci_errno = errno;
  4808. ! #ifdef NAMED_BIND
  4809.               mci->mci_herrno = h_errno;
  4810.   #endif
  4811.               if (i == EX_OK)
  4812. --- 1064,1070 ----
  4813.                   bitnset(M_SECURE_PORT, m->m_flags));
  4814.               mci->mci_exitstat = i;
  4815.               mci->mci_errno = errno;
  4816. ! #if NAMED_BIND
  4817.               mci->mci_herrno = h_errno;
  4818.   #endif
  4819.               if (i == EX_OK)
  4820. ***************
  4821. *** 1223,1229 ****
  4822.                   }
  4823.                   (void) close(rpvect[1]);
  4824.               }
  4825. !             else if (OpMode == MD_SMTP || OpMode == MD_DAEMON || HoldErrs)
  4826.               {
  4827.                   /* put mailer output in transcript */
  4828.                   if (dup2(fileno(e->e_xfp), STDOUT_FILENO) < 0)
  4829. --- 1240,1247 ----
  4830.                   }
  4831.                   (void) close(rpvect[1]);
  4832.               }
  4833. !             else if (OpMode == MD_SMTP || OpMode == MD_DAEMON ||
  4834. !                   HoldErrs || DisConnected)
  4835.               {
  4836.                   /* put mailer output in transcript */
  4837.                   if (dup2(fileno(e->e_xfp), STDOUT_FILENO) < 0)
  4838. ***************
  4839. *** 1260,1271 ****
  4840.                       (void) fcntl(i, F_SETFD, j | 1);
  4841.               }
  4842.   
  4843. !             /* set up the mailer environment */
  4844.               i = 0;
  4845.               env[i++] = "AGENT=sendmail";
  4846.               for (ep = environ; *ep != NULL; ep++)
  4847.               {
  4848. !                 if (strncmp(*ep, "TZ=", 3) == 0)
  4849.                       env[i++] = *ep;
  4850.               }
  4851.               env[i++] = NULL;
  4852. --- 1278,1297 ----
  4853.                       (void) fcntl(i, F_SETFD, j | 1);
  4854.               }
  4855.   
  4856. !             /*
  4857. !             **  Set up the mailer environment
  4858. !             **    TZ is timezone information.
  4859. !             **    SYSTYPE is Apollo software sys type (required).
  4860. !             **    ISP is Apollo hardware system type (required).
  4861. !             */
  4862.               i = 0;
  4863.               env[i++] = "AGENT=sendmail";
  4864.               for (ep = environ; *ep != NULL; ep++)
  4865.               {
  4866. !                 if (strncmp(*ep, "TZ=", 3) == 0 ||
  4867. !                     strncmp(*ep, "ISP=", 4) == 0 ||
  4868. !                     strncmp(*ep, "SYSTYPE=", 8) == 0)
  4869.                       env[i++] = *ep;
  4870.               }
  4871.               env[i++] = NULL;
  4872. ***************
  4873. *** 1344,1350 ****
  4874.           /* couldn't open the mailer */
  4875.           rcode = mci->mci_exitstat;
  4876.           errno = mci->mci_errno;
  4877. ! #ifdef NAMED_BIND
  4878.           h_errno = mci->mci_herrno;
  4879.   #endif
  4880.           if (rcode == EX_OK)
  4881. --- 1370,1376 ----
  4882.           /* couldn't open the mailer */
  4883.           rcode = mci->mci_exitstat;
  4884.           errno = mci->mci_errno;
  4885. ! #if NAMED_BIND
  4886.           h_errno = mci->mci_herrno;
  4887.   #endif
  4888.           if (rcode == EX_OK)
  4889. ***************
  4890. *** 1366,1375 ****
  4891.           **  Format and send message.
  4892.           */
  4893.   
  4894. !         putfromline(mci->mci_out, m, e);
  4895. !         (*e->e_puthdr)(mci->mci_out, m, e);
  4896. !         putline("\n", mci->mci_out, m);
  4897. !         (*e->e_putbody)(mci->mci_out, m, e, NULL);
  4898.   
  4899.           /* get the exit status */
  4900.           rcode = endmailer(mci, e, pv);
  4901. --- 1392,1401 ----
  4902.           **  Format and send message.
  4903.           */
  4904.   
  4905. !         putfromline(mci, e);
  4906. !         (*e->e_puthdr)(mci, e);
  4907. !         putline("\n", mci);
  4908. !         (*e->e_putbody)(mci, e, NULL);
  4909.   
  4910.           /* get the exit status */
  4911.           rcode = endmailer(mci, e, pv);
  4912. ***************
  4913. *** 1437,1443 ****
  4914.           goto give_up;
  4915.       }
  4916.   #endif /* SMTP */
  4917. ! #ifdef NAMED_BIND
  4918.       if (ConfigLevel < 2)
  4919.           _res.options |= RES_DEFNAMES | RES_DNSRCH;    /* XXX */
  4920.   #endif
  4921. --- 1463,1469 ----
  4922.           goto give_up;
  4923.       }
  4924.   #endif /* SMTP */
  4925. ! #if NAMED_BIND
  4926.       if (ConfigLevel < 2)
  4927.           _res.options |= RES_DEFNAMES | RES_DNSRCH;    /* XXX */
  4928.   #endif
  4929. ***************
  4930. *** 1667,1673 ****
  4931.       else if (stat == EX_TEMPFAIL)
  4932.       {
  4933.           (void) strcpy(buf, SysExMsg[i] + 1);
  4934. ! #ifdef NAMED_BIND
  4935.           if (h_errno == TRY_AGAIN)
  4936.               statmsg = errstring(h_errno+E_DNSBASE);
  4937.           else
  4938. --- 1693,1699 ----
  4939.       else if (stat == EX_TEMPFAIL)
  4940.       {
  4941.           (void) strcpy(buf, SysExMsg[i] + 1);
  4942. ! #if NAMED_BIND
  4943.           if (h_errno == TRY_AGAIN)
  4944.               statmsg = errstring(h_errno+E_DNSBASE);
  4945.           else
  4946. ***************
  4947. *** 1691,1697 ****
  4948.           }
  4949.           statmsg = buf;
  4950.       }
  4951. ! #ifdef NAMED_BIND
  4952.       else if (stat == EX_NOHOST && h_errno != 0)
  4953.       {
  4954.           statmsg = errstring(h_errno + E_DNSBASE);
  4955. --- 1717,1723 ----
  4956.           }
  4957.           statmsg = buf;
  4958.       }
  4959. ! #if NAMED_BIND
  4960.       else if (stat == EX_NOHOST && h_errno != 0)
  4961.       {
  4962.           statmsg = errstring(h_errno + E_DNSBASE);
  4963. ***************
  4964. *** 1717,1723 ****
  4965.       {
  4966.           extern char MsgBuf[];
  4967.   
  4968. !         message(&statmsg[4], errstring(errno));
  4969.           if (stat == EX_TEMPFAIL && e->e_xfp != NULL)
  4970.               fprintf(e->e_xfp, "%s\n", &MsgBuf[4]);
  4971.       }
  4972. --- 1743,1749 ----
  4973.       {
  4974.           extern char MsgBuf[];
  4975.   
  4976. !         message("%s", &statmsg[4]);
  4977.           if (stat == EX_TEMPFAIL && e->e_xfp != NULL)
  4978.               fprintf(e->e_xfp, "%s\n", &MsgBuf[4]);
  4979.       }
  4980. ***************
  4981. *** 1737,1742 ****
  4982. --- 1763,1772 ----
  4983.       if (LogLevel > ((stat == EX_TEMPFAIL) ? 8 : (stat == EX_OK) ? 7 : 6))
  4984.           logdelivery(m, mci, &statmsg[4], ctladdr, e);
  4985.   
  4986. +     if (tTd(11, 2))
  4987. +         printf("giveresponse: stat=%d, e->e_message=%s\n",
  4988. +             stat, e->e_message);
  4989.       if (stat != EX_TEMPFAIL)
  4990.           setstat(stat);
  4991.       if (stat != EX_OK && (stat != EX_TEMPFAIL || e->e_message == NULL))
  4992. ***************
  4993. *** 1746,1752 ****
  4994.           e->e_message = newstr(&statmsg[4]);
  4995.       }
  4996.       errno = 0;
  4997. ! #ifdef NAMED_BIND
  4998.       h_errno = 0;
  4999.   #endif
  5000.   }
  5001. --- 1776,1782 ----
  5002.           e->e_message = newstr(&statmsg[4]);
  5003.       }
  5004.       errno = 0;
  5005. ! #if NAMED_BIND
  5006.       h_errno = 0;
  5007.   #endif
  5008.   }
  5009. ***************
  5010. *** 1820,1828 ****
  5011.           (void) strcat(bp, mci->mci_host);
  5012.   
  5013.   # ifdef DAEMON
  5014. !         (void) strcat(bp, " (");
  5015.           (void) strcat(bp, anynet_ntoa(&CurHostAddr));
  5016. !         (void) strcat(bp, ")");
  5017.   # endif
  5018.       }
  5019.       else
  5020. --- 1850,1858 ----
  5021.           (void) strcat(bp, mci->mci_host);
  5022.   
  5023.   # ifdef DAEMON
  5024. !         (void) strcat(bp, " [");
  5025.           (void) strcat(bp, anynet_ntoa(&CurHostAddr));
  5026. !         (void) strcat(bp, "]");
  5027.   # endif
  5028.       }
  5029.       else
  5030. ***************
  5031. *** 1876,1882 ****
  5032.   
  5033.   #  else        /* we have a very short log buffer size */
  5034.   
  5035. !     l = SYSLOG_BUFSIZE - 80;
  5036.       p = e->e_to;
  5037.       while (strlen(p) >= l)
  5038.       {
  5039. --- 1906,1912 ----
  5040.   
  5041.   #  else        /* we have a very short log buffer size */
  5042.   
  5043. !     l = SYSLOG_BUFSIZE - 85;
  5044.       p = e->e_to;
  5045.       while (strlen(p) >= l)
  5046.       {
  5047. ***************
  5048. *** 1914,1920 ****
  5049. --- 1944,1952 ----
  5050.           sprintf(bp, ", mailer=%s", m->m_name);
  5051.           bp += strlen(bp);
  5052.       }
  5053. +     syslog(LOG_INFO, "%s: %s", e->e_id, buf);
  5054.   
  5055. +     buf[0] = '\0';
  5056.       if (mci != NULL && mci->mci_host != NULL)
  5057.       {
  5058.   # ifdef DAEMON
  5059. ***************
  5060. *** 1921,1932 ****
  5061.           extern SOCKADDR CurHostAddr;
  5062.   # endif
  5063.   
  5064. !         sprintf(bp, ", relay=%s", mci->mci_host);
  5065.   
  5066.   # ifdef DAEMON
  5067. !         (void) strcat(bp, " (");
  5068. !         (void) strcat(bp, anynet_ntoa(&CurHostAddr));
  5069. !         (void) strcat(bp, ")");
  5070.   # endif
  5071.       }
  5072.       else
  5073. --- 1953,1964 ----
  5074.           extern SOCKADDR CurHostAddr;
  5075.   # endif
  5076.   
  5077. !         sprintf(buf, "relay=%s", mci->mci_host);
  5078.   
  5079.   # ifdef DAEMON
  5080. !         (void) strcat(buf, " [");
  5081. !         (void) strcat(buf, anynet_ntoa(&CurHostAddr));
  5082. !         (void) strcat(buf, "]");
  5083.   # endif
  5084.       }
  5085.       else
  5086. ***************
  5087. *** 1934,1942 ****
  5088.           char *p = macvalue('h', e);
  5089.   
  5090.           if (p != NULL && p[0] != '\0')
  5091. !             sprintf(bp, ", relay=%s", p);
  5092.       }
  5093. !     syslog(LOG_INFO, "%s: %s", e->e_id, buf);
  5094.   
  5095.       syslog(LOG_INFO, "%s: stat=%s", e->e_id, shortenstring(stat, 63));
  5096.   #  endif /* short log buffer */
  5097. --- 1966,1975 ----
  5098.           char *p = macvalue('h', e);
  5099.   
  5100.           if (p != NULL && p[0] != '\0')
  5101. !             sprintf(buf, "relay=%s", p);
  5102.       }
  5103. !     if (buf[0] != '\0')
  5104. !         syslog(LOG_INFO, "%s: %s", e->e_id, buf);
  5105.   
  5106.       syslog(LOG_INFO, "%s: stat=%s", e->e_id, shortenstring(stat, 63));
  5107.   #  endif /* short log buffer */
  5108. ***************
  5109. *** 1953,1960 ****
  5110.   **    this kind of antique garbage????
  5111.   **
  5112.   **    Parameters:
  5113. ! **        fp -- the file to output to.
  5114. ! **        m -- the mailer describing this entry.
  5115.   **
  5116.   **    Returns:
  5117.   **        none
  5118. --- 1986,1993 ----
  5119.   **    this kind of antique garbage????
  5120.   **
  5121.   **    Parameters:
  5122. ! **        mci -- the connection information.
  5123. ! **        e -- the envelope.
  5124.   **
  5125.   **    Returns:
  5126.   **        none
  5127. ***************
  5128. *** 1963,1981 ****
  5129.   **        outputs some text to fp.
  5130.   */
  5131.   
  5132. ! putfromline(fp, m, e)
  5133. !     register FILE *fp;
  5134. !     register MAILER *m;
  5135.       ENVELOPE *e;
  5136.   {
  5137.       char *template = "\201l\n";
  5138.       char buf[MAXLINE];
  5139.   
  5140. !     if (bitnset(M_NHDR, m->m_flags))
  5141.           return;
  5142.   
  5143.   # ifdef UGLYUUCP
  5144. !     if (bitnset(M_UGLYUUCP, m->m_flags))
  5145.       {
  5146.           char *bang;
  5147.           char xbuf[MAXLINE];
  5148. --- 1996,2013 ----
  5149.   **        outputs some text to fp.
  5150.   */
  5151.   
  5152. ! putfromline(mci, e)
  5153. !     register MCI *mci;
  5154.       ENVELOPE *e;
  5155.   {
  5156.       char *template = "\201l\n";
  5157.       char buf[MAXLINE];
  5158.   
  5159. !     if (bitnset(M_NHDR, mci->mci_mailer->m_flags))
  5160.           return;
  5161.   
  5162.   # ifdef UGLYUUCP
  5163. !     if (bitnset(M_UGLYUUCP, mci->mci_mailer->m_flags))
  5164.       {
  5165.           char *bang;
  5166.           char xbuf[MAXLINE];
  5167. ***************
  5168. *** 1996,2009 ****
  5169.       }
  5170.   # endif /* UGLYUUCP */
  5171.       expand(template, buf, &buf[sizeof buf - 1], e);
  5172. !     putline(buf, fp, m);
  5173.   }
  5174.    /*
  5175.   **  PUTBODY -- put the body of a message.
  5176.   **
  5177.   **    Parameters:
  5178. ! **        fp -- file to output onto.
  5179. ! **        m -- a mailer descriptor to control output format.
  5180.   **        e -- the envelope to put out.
  5181.   **        separator -- if non-NULL, a message separator that must
  5182.   **            not be permitted in the resulting message.
  5183. --- 2028,2040 ----
  5184.       }
  5185.   # endif /* UGLYUUCP */
  5186.       expand(template, buf, &buf[sizeof buf - 1], e);
  5187. !     putline(buf, mci);
  5188.   }
  5189.    /*
  5190.   **  PUTBODY -- put the body of a message.
  5191.   **
  5192.   **    Parameters:
  5193. ! **        mci -- the connection information.
  5194.   **        e -- the envelope to put out.
  5195.   **        separator -- if non-NULL, a message separator that must
  5196.   **            not be permitted in the resulting message.
  5197. ***************
  5198. *** 2015,2023 ****
  5199.   **        The message is written onto fp.
  5200.   */
  5201.   
  5202. ! putbody(fp, m, e, separator)
  5203. !     FILE *fp;
  5204. !     MAILER *m;
  5205.       register ENVELOPE *e;
  5206.       char *separator;
  5207.   {
  5208. --- 2046,2053 ----
  5209.   **        The message is written onto fp.
  5210.   */
  5211.   
  5212. ! putbody(mci, e, separator)
  5213. !     register MCI *mci;
  5214.       register ENVELOPE *e;
  5215.       char *separator;
  5216.   {
  5217. ***************
  5218. *** 2037,2052 ****
  5219.                   e->e_df, e->e_to, e->e_from.q_paddr);
  5220.           }
  5221.           else
  5222. !             putline("<<< No Message Collected >>>", fp, m);
  5223.       }
  5224.       if (e->e_dfp != NULL)
  5225.       {
  5226.           rewind(e->e_dfp);
  5227. !         while (!ferror(fp) && fgets(buf, sizeof buf, e->e_dfp) != NULL)
  5228.           {
  5229. !             if (buf[0] == 'F' && bitnset(M_ESCFROM, m->m_flags) &&
  5230.                   strncmp(buf, "From ", 5) == 0)
  5231. !                 (void) putc('>', fp);
  5232.               if (buf[0] == '-' && buf[1] == '-' && separator != NULL)
  5233.               {
  5234.                   /* possible separator */
  5235. --- 2067,2083 ----
  5236.                   e->e_df, e->e_to, e->e_from.q_paddr);
  5237.           }
  5238.           else
  5239. !             putline("<<< No Message Collected >>>", mci);
  5240.       }
  5241.       if (e->e_dfp != NULL)
  5242.       {
  5243.           rewind(e->e_dfp);
  5244. !         while (!ferror(mci->mci_out) && fgets(buf, sizeof buf, e->e_dfp) != NULL)
  5245.           {
  5246. !             if (buf[0] == 'F' &&
  5247. !                 bitnset(M_ESCFROM, mci->mci_mailer->m_flags) &&
  5248.                   strncmp(buf, "From ", 5) == 0)
  5249. !                 (void) putc('>', mci->mci_out);
  5250.               if (buf[0] == '-' && buf[1] == '-' && separator != NULL)
  5251.               {
  5252.                   /* possible separator */
  5253. ***************
  5254. *** 2053,2061 ****
  5255.                   int sl = strlen(separator);
  5256.   
  5257.                   if (strncmp(&buf[2], separator, sl) == 0)
  5258. !                     (void) putc(' ', fp);
  5259.               }
  5260. !             putline(buf, fp, m);
  5261.           }
  5262.   
  5263.           if (ferror(e->e_dfp))
  5264. --- 2084,2092 ----
  5265.                   int sl = strlen(separator);
  5266.   
  5267.                   if (strncmp(&buf[2], separator, sl) == 0)
  5268. !                     (void) putc(' ', mci->mci_out);
  5269.               }
  5270. !             putline(buf, mci);
  5271.           }
  5272.   
  5273.           if (ferror(e->e_dfp))
  5274. ***************
  5275. *** 2066,2076 ****
  5276.       }
  5277.   
  5278.       /* some mailers want extra blank line at end of message */
  5279. !     if (bitnset(M_BLANKEND, m->m_flags) && buf[0] != '\0' && buf[0] != '\n')
  5280. !         putline("", fp, m);
  5281.   
  5282. !     (void) fflush(fp);
  5283. !     if (ferror(fp) && errno != EPIPE)
  5284.       {
  5285.           syserr("putbody: write error");
  5286.           ExitStat = EX_IOERR;
  5287. --- 2097,2108 ----
  5288.       }
  5289.   
  5290.       /* some mailers want extra blank line at end of message */
  5291. !     if (bitnset(M_BLANKEND, mci->mci_mailer->m_flags) &&
  5292. !         buf[0] != '\0' && buf[0] != '\n')
  5293. !         putline("", mci);
  5294.   
  5295. !     (void) fflush(mci->mci_out);
  5296. !     if (ferror(mci->mci_out) && errno != EPIPE)
  5297.       {
  5298.           syserr("putbody: write error");
  5299.           ExitStat = EX_IOERR;
  5300. ***************
  5301. *** 2135,2140 ****
  5302. --- 2167,2173 ----
  5303.       {
  5304.           /* child -- actually write to file */
  5305.           struct stat stb;
  5306. +         MCI mcibuf;
  5307.   
  5308.           (void) setsignal(SIGINT, SIG_DFL);
  5309.           (void) setsignal(SIGHUP, SIG_DFL);
  5310. ***************
  5311. *** 2197,2207 ****
  5312.               exit(EX_CANTCREAT);
  5313.           }
  5314.   
  5315. !         putfromline(f, FileMailer, e);
  5316. !         (*e->e_puthdr)(f, FileMailer, e);
  5317. !         putline("\n", f, FileMailer);
  5318. !         (*e->e_putbody)(f, FileMailer, e, NULL);
  5319. !         putline("\n", f, FileMailer);
  5320.           if (ferror(f))
  5321.           {
  5322.               message("451 I/O error: %s", errstring(errno));
  5323. --- 2230,2246 ----
  5324.               exit(EX_CANTCREAT);
  5325.           }
  5326.   
  5327. !         bzero(&mcibuf, sizeof mcibuf);
  5328. !         mcibuf.mci_mailer = FileMailer;
  5329. !         mcibuf.mci_out = f;
  5330. !         if (bitnset(M_7BITS, FileMailer->m_flags))
  5331. !             mcibuf.mci_flags |= MCIF_7BIT;
  5332. !         putfromline(&mcibuf, e);
  5333. !         (*e->e_puthdr)(&mcibuf, e);
  5334. !         putline("\n", &mcibuf);
  5335. !         (*e->e_putbody)(&mcibuf, e, NULL);
  5336. !         putline("\n", &mcibuf);
  5337.           if (ferror(f))
  5338.           {
  5339.               message("451 I/O error: %s", errstring(errno));
  5340. ***************
  5341. *** 2260,2266 ****
  5342.       register STAB *s;
  5343.       int i;
  5344.       int len;
  5345. ! #ifdef NAMED_BIND
  5346.       int nmx;
  5347.       auto int rcode;
  5348.       char *hp;
  5349. --- 2299,2305 ----
  5350.       register STAB *s;
  5351.       int i;
  5352.       int len;
  5353. ! #if NAMED_BIND
  5354.       int nmx;
  5355.       auto int rcode;
  5356.       char *hp;
  5357. ***************
  5358. *** 2292,2298 ****
  5359.       **  Not already there -- create a signature.
  5360.       */
  5361.   
  5362. ! #ifdef NAMED_BIND
  5363.       if (ConfigLevel < 2)
  5364.       {
  5365.           oldoptions = _res.options;
  5366. --- 2331,2337 ----
  5367.       **  Not already there -- create a signature.
  5368.       */
  5369.   
  5370. ! #if NAMED_BIND
  5371.       if (ConfigLevel < 2)
  5372.       {
  5373.           oldoptions = _res.options;
  5374. ***************
  5375. *** 2315,2321 ****
  5376.               mci = mci_get(hp, m);
  5377.               mci->mci_exitstat = rcode;
  5378.               mci->mci_errno = errno;
  5379. ! #ifdef NAMED_BIND
  5380.               mci->mci_herrno = h_errno;
  5381.   #endif
  5382.   
  5383. --- 2354,2360 ----
  5384.               mci = mci_get(hp, m);
  5385.               mci->mci_exitstat = rcode;
  5386.               mci->mci_errno = errno;
  5387. ! #if NAMED_BIND
  5388.               mci->mci_herrno = h_errno;
  5389.   #endif
  5390.   
  5391. *** src/domain.c.OLD    Tue Dec 21 14:52:18 1993
  5392. --- src/domain.c    Fri Mar 11 14:42:21 1994
  5393. ***************
  5394. *** 35,48 ****
  5395.   #include "sendmail.h"
  5396.   
  5397.   #ifndef lint
  5398. ! #ifdef NAMED_BIND
  5399. ! static char sccsid[] = "@(#)domain.c    8.10 (Berkeley) 12/21/93 (with name server)";
  5400.   #else
  5401. ! static char sccsid[] = "@(#)domain.c    8.10 (Berkeley) 12/21/93 (without name server)";
  5402.   #endif
  5403.   #endif /* not lint */
  5404.   
  5405. ! #ifdef NAMED_BIND
  5406.   
  5407.   #include <errno.h>
  5408.   #include <arpa/nameser.h>
  5409. --- 35,48 ----
  5410.   #include "sendmail.h"
  5411.   
  5412.   #ifndef lint
  5413. ! #if NAMED_BIND
  5414. ! static char sccsid[] = "@(#)domain.c    8.19 (Berkeley) 3/11/94 (with name server)";
  5415.   #else
  5416. ! static char sccsid[] = "@(#)domain.c    8.19 (Berkeley) 3/11/94 (without name server)";
  5417.   #endif
  5418.   #endif /* not lint */
  5419.   
  5420. ! #if NAMED_BIND
  5421.   
  5422.   #include <errno.h>
  5423.   #include <arpa/nameser.h>
  5424. ***************
  5425. *** 69,74 ****
  5426. --- 69,78 ----
  5427.   # define NO_DATA    NO_ADDRESS
  5428.   #endif
  5429.   
  5430. + #ifndef HEADERSZ
  5431. + # define HEADERSZ    sizeof(HEADER)
  5432. + #endif
  5433.   /* don't use sizeof because sizeof(long) is different on 64-bit machines */
  5434.   #define SHORTSIZE    2    /* size of a short (really, must be 2) */
  5435.   #define LONGSIZE    4    /* size of a long (really, must be 4) */
  5436. ***************
  5437. *** 116,121 ****
  5438. --- 120,128 ----
  5439.       int weight[MAXMXHOSTS];
  5440.       extern bool getcanonname();
  5441.   
  5442. +     if (tTd(8, 2))
  5443. +         printf("getmxrr(%s, droplocalhost=%d)\n", host, droplocalhost);
  5444.       if (fallbackMX != NULL)
  5445.       {
  5446.           if (firsttime && res_query(FallBackMX, C_IN, T_A,
  5447. ***************
  5448. *** 156,161 ****
  5449. --- 163,172 ----
  5450.               goto punt;
  5451.   
  5452.             case HOST_NOT_FOUND:
  5453. + #ifdef BROKEN_RES_SEARCH
  5454. +             /* Ultrix resolver returns failure w/ h_errno=0 */
  5455. +           case 0:
  5456. + #endif
  5457.               /* the host just doesn't exist */
  5458.               *rcode = EX_NOHOST;
  5459.   
  5460. ***************
  5461. *** 174,179 ****
  5462. --- 185,196 ----
  5463.               /* it might come up later; better queue it up */
  5464.               *rcode = EX_TEMPFAIL;
  5465.               break;
  5466. +           default:
  5467. +             syserr("getmxrr: res_search (%s) failed with impossible h_errno (%d)\n",
  5468. +                 host, h_errno);
  5469. +             *rcode = EX_OSERR;
  5470. +             break;
  5471.           }
  5472.   
  5473.           /* irreconcilable differences */
  5474. ***************
  5475. *** 182,188 ****
  5476.   
  5477.       /* find first satisfactory answer */
  5478.       hp = (HEADER *)&answer;
  5479. !     cp = (u_char *)&answer + sizeof(HEADER);
  5480.       eom = (u_char *)&answer + n;
  5481.       for (qdcount = ntohs(hp->qdcount); qdcount--; cp += n + QFIXEDSZ)
  5482.           if ((n = dn_skipname(cp, eom)) < 0)
  5483. --- 199,205 ----
  5484.   
  5485.       /* find first satisfactory answer */
  5486.       hp = (HEADER *)&answer;
  5487. !     cp = (u_char *)&answer + HEADERSZ;
  5488.       eom = (u_char *)&answer + n;
  5489.       for (qdcount = ntohs(hp->qdcount); qdcount--; cp += n + QFIXEDSZ)
  5490.           if ((n = dn_skipname(cp, eom)) < 0)
  5491. ***************
  5492. *** 216,221 ****
  5493. --- 233,241 ----
  5494.               (st = stab(bp, ST_CLASS, ST_FIND)) != NULL &&
  5495.               bitnset('w', st->s_class))
  5496.           {
  5497. +             if (tTd(8, 3))
  5498. +                 printf("found localhost (%s) in MX list, pref=%d\n",
  5499. +                     bp, pref);
  5500.               if (!seenlocal || pref < localpref)
  5501.                   localpref = pref;
  5502.               seenlocal = TRUE;
  5503. ***************
  5504. *** 283,288 ****
  5505. --- 303,310 ----
  5506.               */
  5507.   
  5508.               *rcode = EX_CONFIG;
  5509. +             syserr("MX list for %s points back to %s",
  5510. +                 host, MyHostName);
  5511.               return -1;
  5512.           }
  5513.           strcpy(MXHostBuf, host);
  5514. ***************
  5515. *** 365,371 ****
  5516.   
  5517.           if (isascii(c) && isupper(c))
  5518.               c = tolower(c);
  5519. !         hfunc = ((hfunc << 1) + c) % 2003;
  5520.       }
  5521.   
  5522.       hfunc &= 0xff;
  5523. --- 387,393 ----
  5524.   
  5525.           if (isascii(c) && isupper(c))
  5526.               c = tolower(c);
  5527. !         hfunc = ((hfunc << 1) ^ c) % 2003;
  5528.       }
  5529.   
  5530.       hfunc &= 0xff;
  5531. ***************
  5532. *** 478,483 ****
  5533. --- 500,509 ----
  5534.       {
  5535.           *dp++ = _res.defdname;
  5536.       }
  5537. +     else if (*cp == '.')
  5538. +     {
  5539. +         *cp = '\0';
  5540. +     }
  5541.       *dp = NULL;
  5542.   
  5543.       /*
  5544. ***************
  5545. *** 546,552 ****
  5546.           */
  5547.   
  5548.           hp = (HEADER *) &answer;
  5549. !         ap = (u_char *) &answer + sizeof(HEADER);
  5550.           eom = (u_char *) &answer + ret;
  5551.   
  5552.           /* skip question part of response -- we know what we asked */
  5553. --- 572,578 ----
  5554.           */
  5555.   
  5556.           hp = (HEADER *) &answer;
  5557. !         ap = (u_char *) &answer + HEADERSZ;
  5558.           eom = (u_char *) &answer + ret;
  5559.   
  5560.           /* skip question part of response -- we know what we asked */
  5561. ***************
  5562. *** 597,605 ****
  5563.                 case T_CNAME:
  5564.                   if (loopcnt++ > MAXCNAMEDEPTH)
  5565.                   {
  5566. !                     syserr("DNS failure: CNAME loop for %s",
  5567.                           host);
  5568. !                     continue;
  5569.                   }
  5570.   
  5571.                   /* value points at name */
  5572. --- 623,641 ----
  5573.                 case T_CNAME:
  5574.                   if (loopcnt++ > MAXCNAMEDEPTH)
  5575.                   {
  5576. !                     /*XXX should notify postmaster XXX*/
  5577. !                     message("DNS failure: CNAME loop for %s",
  5578.                           host);
  5579. !                     if (CurEnv->e_message == NULL)
  5580. !                     {
  5581. !                         char ebuf[MAXLINE];
  5582. !                         sprintf(ebuf, "Deferred: DNS failure: CNAME loop for %s",
  5583. !                             host);
  5584. !                         CurEnv->e_message = newstr(ebuf);
  5585. !                     }
  5586. !                     h_errno = NO_RECOVERY;
  5587. !                     return FALSE;
  5588.                   }
  5589.   
  5590.                   /* value points at name */
  5591. *** src/envelope.c.OLD    Sun Jan  9 09:22:39 1994
  5592. --- src/envelope.c    Fri Feb 25 20:33:10 1994
  5593. ***************
  5594. *** 33,43 ****
  5595.    */
  5596.   
  5597.   #ifndef lint
  5598. ! static char sccsid[] = "@(#)envelope.c    8.28 (Berkeley) 1/9/94";
  5599.   #endif /* not lint */
  5600.   
  5601.   #include "sendmail.h"
  5602. - #include <sys/time.h>
  5603.   #include <pwd.h>
  5604.   
  5605.   /*
  5606. --- 33,42 ----
  5607.    */
  5608.   
  5609.   #ifndef lint
  5610. ! static char sccsid[] = "@(#)envelope.c    8.33 (Berkeley) 2/10/94";
  5611.   #endif /* not lint */
  5612.   
  5613.   #include "sendmail.h"
  5614.   #include <pwd.h>
  5615.   
  5616.   /*
  5617. ***************
  5618. *** 585,591 ****
  5619.       */
  5620.   
  5621.       if (bitset(EF_QUEUERUN, e->e_flags) || OpMode == MD_SMTP ||
  5622. !         OpMode == MD_DAEMON)
  5623.           realname = from;
  5624.       if (realname == NULL || realname[0] == '\0')
  5625.           realname = username();
  5626. --- 584,590 ----
  5627.       */
  5628.   
  5629.       if (bitset(EF_QUEUERUN, e->e_flags) || OpMode == MD_SMTP ||
  5630. !         OpMode == MD_ARPAFTP || OpMode == MD_DAEMON)
  5631.           realname = from;
  5632.       if (realname == NULL || realname[0] == '\0')
  5633.           realname = username();
  5634. ***************
  5635. *** 694,702 ****
  5636.               **  Process passwd file entry.
  5637.               */
  5638.   
  5639.               /* extract home directory */
  5640. !             e->e_from.q_home = newstr(pw->pw_dir);
  5641.               define('z', e->e_from.q_home, e);
  5642.   
  5643.               /* extract user and group id */
  5644. --- 693,703 ----
  5645.               **  Process passwd file entry.
  5646.               */
  5647.   
  5648.               /* extract home directory */
  5649. !             if (strcmp(pw->pw_dir, "/") == 0)
  5650. !                 e->e_from.q_home = newstr("");
  5651. !             else
  5652. !                 e->e_from.q_home = newstr(pw->pw_dir);
  5653.               define('z', e->e_from.q_home, e);
  5654.   
  5655.               /* extract user and group id */
  5656. ***************
  5657. *** 720,726 ****
  5658. --- 721,732 ----
  5659.       else if (!internal && OpMode != MD_DAEMON)
  5660.       {
  5661.           if (e->e_from.q_home == NULL)
  5662. +         {
  5663.               e->e_from.q_home = getenv("HOME");
  5664. +             if (e->e_from.q_home != NULL &&
  5665. +                 strcmp(e->e_from.q_home, "/") == 0)
  5666. +                 e->e_from.q_home++;
  5667. +         }
  5668.           e->e_from.q_uid = RealUid;
  5669.           e->e_from.q_gid = RealGid;
  5670.           e->e_from.q_flags |= QGOODUID;
  5671. *** src/err.c.OLD    Sat Jan  8 17:29:31 1994
  5672. --- src/err.c    Fri Mar 11 14:42:21 1994
  5673. ***************
  5674. *** 33,44 ****
  5675.    */
  5676.   
  5677.   #ifndef lint
  5678. ! static char sccsid[] = "@(#)err.c    8.19 (Berkeley) 1/8/94";
  5679.   #endif /* not lint */
  5680.   
  5681.   # include "sendmail.h"
  5682.   # include <errno.h>
  5683.   # include <netdb.h>
  5684.   
  5685.   /*
  5686.   **  SYSERR -- Print error message.
  5687. --- 33,45 ----
  5688.    */
  5689.   
  5690.   #ifndef lint
  5691. ! static char sccsid[] = "@(#)err.c    8.26 (Berkeley) 3/11/94";
  5692.   #endif /* not lint */
  5693.   
  5694.   # include "sendmail.h"
  5695.   # include <errno.h>
  5696.   # include <netdb.h>
  5697. + # include <pwd.h>
  5698.   
  5699.   /*
  5700.   **  SYSERR -- Print error message.
  5701. ***************
  5702. *** 68,74 ****
  5703.   
  5704.   static void    fmtmsg();
  5705.   
  5706. ! #if defined(NAMED_BIND) && !defined(NO_DATA)
  5707.   # define NO_DATA    NO_ADDRESS
  5708.   #endif
  5709.   
  5710. --- 69,75 ----
  5711.   
  5712.   static void    fmtmsg();
  5713.   
  5714. ! #if NAMED_BIND && !defined(NO_DATA)
  5715.   # define NO_DATA    NO_ADDRESS
  5716.   #endif
  5717.   
  5718. ***************
  5719. *** 85,90 ****
  5720. --- 86,96 ----
  5721.       register char *p;
  5722.       int olderrno = errno;
  5723.       bool panic;
  5724. + #ifdef LOG
  5725. +     char *uname;
  5726. +     struct passwd *pw;
  5727. +     char ubuf[80];
  5728. + #endif
  5729.       VA_LOCAL_DECL
  5730.   
  5731.       panic = *fmt == '!';
  5732. ***************
  5733. *** 108,120 ****
  5734.               ExitStat = EX_SOFTWARE;
  5735.           else
  5736.               ExitStat = EX_OSERR;
  5737.       }
  5738.   
  5739.   # ifdef LOG
  5740.       if (LogLevel > 0)
  5741. !         syslog(panic ? LOG_ALERT : LOG_CRIT, "%s: SYSERR: %s",
  5742.               CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
  5743. !             &MsgBuf[4]);
  5744.   # endif /* LOG */
  5745.       if (olderrno == EMFILE)
  5746.       {
  5747. --- 114,137 ----
  5748.               ExitStat = EX_SOFTWARE;
  5749.           else
  5750.               ExitStat = EX_OSERR;
  5751. +         if (tTd(54, 1))
  5752. +             printf("syserr: ExitStat = %d\n", ExitStat);
  5753.       }
  5754.   
  5755.   # ifdef LOG
  5756. +     pw = getpwuid(getuid());
  5757. +     if (pw != NULL)
  5758. +         uname = pw->pw_name;
  5759. +     else
  5760. +     {
  5761. +         uname = ubuf;
  5762. +         sprintf(ubuf, "UID%d", getuid());
  5763. +     }
  5764.       if (LogLevel > 0)
  5765. !         syslog(panic ? LOG_ALERT : LOG_CRIT, "%s: SYSERR(%s): %s",
  5766.               CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
  5767. !             uname, &MsgBuf[4]);
  5768.   # endif /* LOG */
  5769.       if (olderrno == EMFILE)
  5770.       {
  5771. ***************
  5772. *** 285,291 ****
  5773.           msg[0] = '5';
  5774.   
  5775.       (void) fflush(stdout);
  5776. !     if (OpMode == MD_SMTP || OpMode == MD_DAEMON)
  5777.           fprintf(OutChannel, "%s\r\n", msg);
  5778.       else
  5779.           fprintf(OutChannel, "%s\n", &msg[4]);
  5780. --- 302,311 ----
  5781.           msg[0] = '5';
  5782.   
  5783.       (void) fflush(stdout);
  5784. !     /* if DisConnected, OutChannel now points to the transcript */
  5785. !     if (!DisConnected &&
  5786. !         (OpMode == MD_SMTP || OpMode == MD_DAEMON || OpMode == MD_ARPAFTP))
  5787.           fprintf(OutChannel, "%s\r\n", msg);
  5788.       else
  5789.           fprintf(OutChannel, "%s\n", &msg[4]);
  5790. ***************
  5791. *** 294,300 ****
  5792.               (OpMode == MD_SMTP || OpMode == MD_DAEMON) ? msg : &msg[4]);
  5793.       if (msg[3] == ' ')
  5794.           (void) fflush(OutChannel);
  5795. !     if (!ferror(OutChannel))
  5796.           return;
  5797.   
  5798.       /*
  5799. --- 314,320 ----
  5800.               (OpMode == MD_SMTP || OpMode == MD_DAEMON) ? msg : &msg[4]);
  5801.       if (msg[3] == ' ')
  5802.           (void) fflush(OutChannel);
  5803. !     if (!ferror(OutChannel) || DisConnected)
  5804.           return;
  5805.   
  5806.       /*
  5807. ***************
  5808. *** 404,410 ****
  5809.       /* output the "to" person */
  5810.       if (to != NULL && to[0] != '\0')
  5811.       {
  5812. !         (void) sprintf(eb, "%s... ", to);
  5813.           while (*eb != '\0')
  5814.               *eb++ &= 0177;
  5815.       }
  5816. --- 424,430 ----
  5817.       /* output the "to" person */
  5818.       if (to != NULL && to[0] != '\0')
  5819.       {
  5820. !         (void) sprintf(eb, "%s... ", shortenstring(to, 203));
  5821.           while (*eb != '\0')
  5822.               *eb++ &= 0177;
  5823.       }
  5824. ***************
  5825. *** 434,443 ****
  5826.   **  ERRSTRING -- return string description of error code
  5827.   **
  5828.   **    Parameters:
  5829. ! **        errno -- the error number to translate
  5830.   **
  5831.   **    Returns:
  5832. ! **        A string description of errno.
  5833.   **
  5834.   **    Side Effects:
  5835.   **        none.
  5836. --- 454,463 ----
  5837.   **  ERRSTRING -- return string description of error code
  5838.   **
  5839.   **    Parameters:
  5840. ! **        errnum -- the error number to translate
  5841.   **
  5842.   **    Returns:
  5843. ! **        A string description of errnum.
  5844.   **
  5845.   **    Side Effects:
  5846.   **        none.
  5847. ***************
  5848. *** 444,451 ****
  5849.   */
  5850.   
  5851.   const char *
  5852. ! errstring(errno)
  5853. !     int errno;
  5854.   {
  5855.       char *dnsmsg;
  5856.       static char buf[MAXLINE];
  5857. --- 464,471 ----
  5858.   */
  5859.   
  5860.   const char *
  5861. ! errstring(errnum)
  5862. !     int errnum;
  5863.   {
  5864.       char *dnsmsg;
  5865.       static char buf[MAXLINE];
  5866. ***************
  5867. *** 464,475 ****
  5868.       */
  5869.   
  5870.       dnsmsg = NULL;
  5871. !     switch (errno)
  5872.       {
  5873.   # if defined(DAEMON) && defined(ETIMEDOUT)
  5874.         case ETIMEDOUT:
  5875.         case ECONNRESET:
  5876. !         (void) strcpy(buf, sys_errlist[errno]);
  5877.           if (SmtpPhase != NULL)
  5878.           {
  5879.               (void) strcat(buf, " during ");
  5880. --- 484,495 ----
  5881.       */
  5882.   
  5883.       dnsmsg = NULL;
  5884. !     switch (errnum)
  5885.       {
  5886.   # if defined(DAEMON) && defined(ETIMEDOUT)
  5887.         case ETIMEDOUT:
  5888.         case ECONNRESET:
  5889. !         (void) strcpy(buf, sys_errlist[errnum]);
  5890.           if (SmtpPhase != NULL)
  5891.           {
  5892.               (void) strcat(buf, " during ");
  5893. ***************
  5894. *** 498,504 ****
  5895.         case EOPENTIMEOUT:
  5896.           return "Timeout on file open";
  5897.   
  5898. ! # ifdef NAMED_BIND
  5899.         case HOST_NOT_FOUND + E_DNSBASE:
  5900.           dnsmsg = "host not found";
  5901.           break;
  5902. --- 518,524 ----
  5903.         case EOPENTIMEOUT:
  5904.           return "Timeout on file open";
  5905.   
  5906. ! # if NAMED_BIND
  5907.         case HOST_NOT_FOUND + E_DNSBASE:
  5908.           dnsmsg = "host not found";
  5909.           break;
  5910. ***************
  5911. *** 533,541 ****
  5912.           return buf;
  5913.       }
  5914.   
  5915. !     if (errno > 0 && errno < sys_nerr)
  5916. !         return (sys_errlist[errno]);
  5917.   
  5918. !     (void) sprintf(buf, "Error %d", errno);
  5919.       return (buf);
  5920.   }
  5921. --- 553,561 ----
  5922.           return buf;
  5923.       }
  5924.   
  5925. !     if (errnum > 0 && errnum < sys_nerr)
  5926. !         return (sys_errlist[errnum]);
  5927.   
  5928. !     (void) sprintf(buf, "Error %d", errnum);
  5929.       return (buf);
  5930.   }
  5931. *** src/headers.c.OLD    Wed Jan 12 12:38:49 1994
  5932. --- src/headers.c    Wed Mar  2 15:35:54 1994
  5933. ***************
  5934. *** 33,39 ****
  5935.    */
  5936.   
  5937.   #ifndef lint
  5938. ! static char sccsid[] = "@(#)headers.c    8.21 (Berkeley) 1/12/94";
  5939.   #endif /* not lint */
  5940.   
  5941.   # include <errno.h>
  5942. --- 33,39 ----
  5943.    */
  5944.   
  5945.   #ifndef lint
  5946. ! static char sccsid[] = "@(#)headers.c    8.30 (Berkeley) 2/25/94";
  5947.   #endif /* not lint */
  5948.   
  5949.   # include <errno.h>
  5950. ***************
  5951. *** 163,168 ****
  5952. --- 163,169 ----
  5953.           {
  5954.               auto ADDRESS a;
  5955.               char *fancy;
  5956. +             bool oldSuprErrs = SuprErrs;
  5957.               extern char *crackaddr();
  5958.               extern char *udbsender();
  5959.   
  5960. ***************
  5961. *** 170,177 ****
  5962. --- 171,186 ----
  5963.               **  Try doing USERDB rewriting even on fully commented
  5964.               **  names; this saves the "comment" information (such
  5965.               **  as full name) and rewrites the electronic part.
  5966. +             **
  5967. +             ** XXX    This code doesn't belong here -- parsing should
  5968. +             ** XXX    not be done during collect() phase because
  5969. +             ** XXX    error messages can confuse the SMTP phase.
  5970. +             ** XXX    Setting SuprErrs is a crude hack around this
  5971. +             ** XXX    problem.
  5972.               */
  5973.   
  5974. +             if (OpMode == MD_SMTP || OpMode == MD_ARPAFTP)
  5975. +                 SuprErrs = TRUE;
  5976.               fancy = crackaddr(fvalue);
  5977.               if (parseaddr(fvalue, &a, RF_COPYNONE, '\0', NULL, e) != NULL &&
  5978.                   a.q_mailer == LocalMailer &&
  5979. ***************
  5980. *** 184,189 ****
  5981. --- 193,199 ----
  5982.                   define('g', oldg, e);
  5983.                   fvalue = buf;
  5984.               }
  5985. +             SuprErrs = oldSuprErrs;
  5986.           }
  5987.   #endif
  5988.   #endif
  5989. ***************
  5990. *** 470,475 ****
  5991. --- 480,511 ----
  5992.           define('a', p, e);
  5993.   
  5994.       /*
  5995. +     **  From person in antiquated ARPANET mode
  5996. +     **    required by UK Grey Book e-mail gateways (sigh)
  5997. +     */
  5998. +     if (OpMode == MD_ARPAFTP)
  5999. +     {
  6000. +         register struct hdrinfo *hi;
  6001. +         for (hi = HdrInfo; hi->hi_field != NULL; hi++)
  6002. +         {
  6003. +             if (bitset(H_FROM, hi->hi_flags) &&
  6004. +                 (!bitset(H_RESENT, hi->hi_flags) ||
  6005. +                  bitset(EF_RESENT, e->e_flags)) &&
  6006. +                 (p = hvalue(hi->hi_field, e)) != NULL)
  6007. +                 break;
  6008. +         }
  6009. +         if (hi->hi_field != NULL)
  6010. +         {
  6011. +             if (tTd(32, 2))
  6012. +                 printf("eatheader: setsender(*%s == %s)\n",
  6013. +                     hi->hi_field, p);
  6014. +             setsender(p, e, NULL, TRUE);
  6015. +         }
  6016. +     }
  6017. +     /*
  6018.       **  Log collection information.
  6019.       */
  6020.   
  6021. ***************
  6022. *** 504,509 ****
  6023. --- 540,547 ----
  6024.           name = "[RESPONSE]";
  6025.       else if ((name = macvalue('_', e)) != NULL)
  6026.           ;
  6027. +     else if (RealHostName == NULL)
  6028. +         name = "localhost";
  6029.       else if (RealHostName[0] == '[')
  6030.           name = RealHostName;
  6031.       else
  6032. ***************
  6033. *** 561,567 ****
  6034.       p = macvalue('r', e);
  6035.       if (p != NULL)
  6036.       {
  6037. !         sprintf(sbp, " proto=%s,", e->e_id, p);
  6038.           sbp += strlen(sbp);
  6039.       }
  6040.       syslog(LOG_INFO, "%s relay=%s", sbuf, name);
  6041. --- 599,605 ----
  6042.       p = macvalue('r', e);
  6043.       if (p != NULL)
  6044.       {
  6045. !         sprintf(sbp, " proto=%s,", p);
  6046.           sbp += strlen(sbp);
  6047.       }
  6048.       syslog(LOG_INFO, "%s relay=%s", sbuf, name);
  6049. ***************
  6050. *** 860,867 ****
  6051.   **  PUTHEADER -- put the header part of a message from the in-core copy
  6052.   **
  6053.   **    Parameters:
  6054. ! **        fp -- file to put it on.
  6055. ! **        m -- mailer to use.
  6056.   **        e -- envelope to use.
  6057.   **
  6058.   **    Returns:
  6059. --- 898,904 ----
  6060.   **  PUTHEADER -- put the header part of a message from the in-core copy
  6061.   **
  6062.   **    Parameters:
  6063. ! **        mci -- the connection information.
  6064.   **        e -- envelope to use.
  6065.   **
  6066.   **    Returns:
  6067. ***************
  6068. *** 878,886 ****
  6069.   # define MAX(a,b) (((a)>(b))?(a):(b))
  6070.   #endif
  6071.   
  6072. ! putheader(fp, m, e)
  6073. !     register FILE *fp;
  6074. !     register MAILER *m;
  6075.       register ENVELOPE *e;
  6076.   {
  6077.       char buf[MAX(MAXLINE,BUFSIZ)];
  6078. --- 915,922 ----
  6079.   # define MAX(a,b) (((a)>(b))?(a):(b))
  6080.   #endif
  6081.   
  6082. ! putheader(mci, e)
  6083. !     register MCI *mci;
  6084.       register ENVELOPE *e;
  6085.   {
  6086.       char buf[MAX(MAXLINE,BUFSIZ)];
  6087. ***************
  6088. *** 888,894 ****
  6089.       char obuf[MAXLINE];
  6090.   
  6091.       if (tTd(34, 1))
  6092. !         printf("--- putheader, mailer = %s ---\n", m->m_name);
  6093.   
  6094.       for (h = e->e_header; h != NULL; h = h->h_link)
  6095.       {
  6096. --- 924,931 ----
  6097.       char obuf[MAXLINE];
  6098.   
  6099.       if (tTd(34, 1))
  6100. !         printf("--- putheader, mailer = %s ---\n",
  6101. !             mci->mci_mailer->m_name);
  6102.   
  6103.       for (h = e->e_header; h != NULL; h = h->h_link)
  6104.       {
  6105. ***************
  6106. *** 902,908 ****
  6107.           }
  6108.   
  6109.           if (bitset(H_CHECK|H_ACHECK, h->h_flags) &&
  6110. !             !bitintersect(h->h_mflags, m->m_flags))
  6111.           {
  6112.               if (tTd(34, 11))
  6113.                   printf(" (skipped)\n");
  6114. --- 939,945 ----
  6115.           }
  6116.   
  6117.           if (bitset(H_CHECK|H_ACHECK, h->h_flags) &&
  6118. !             !bitintersect(h->h_mflags, mci->mci_mailer->m_flags))
  6119.           {
  6120.               if (tTd(34, 11))
  6121.                   printf(" (skipped)\n");
  6122. ***************
  6123. *** 941,947 ****
  6124.   
  6125.               if (bitset(H_FROM, h->h_flags))
  6126.                   oldstyle = FALSE;
  6127. !             commaize(h, p, fp, oldstyle, m, e);
  6128.           }
  6129.           else
  6130.           {
  6131. --- 978,984 ----
  6132.   
  6133.               if (bitset(H_FROM, h->h_flags))
  6134.                   oldstyle = FALSE;
  6135. !             commaize(h, p, oldstyle, mci, e);
  6136.           }
  6137.           else
  6138.           {
  6139. ***************
  6140. *** 954,965 ****
  6141.                   *nlp = '\0';
  6142.                   (void) strcat(obuf, p);
  6143.                   *nlp = '\n';
  6144. !                 putline(obuf, fp, m);
  6145.                   p = ++nlp;
  6146.                   obuf[0] = '\0';
  6147.               }
  6148.               (void) strcat(obuf, p);
  6149. !             putline(obuf, fp, m);
  6150.           }
  6151.       }
  6152.   }
  6153. --- 991,1002 ----
  6154.                   *nlp = '\0';
  6155.                   (void) strcat(obuf, p);
  6156.                   *nlp = '\n';
  6157. !                 putline(obuf, mci);
  6158.                   p = ++nlp;
  6159.                   obuf[0] = '\0';
  6160.               }
  6161.               (void) strcat(obuf, p);
  6162. !             putline(obuf, mci);
  6163.           }
  6164.       }
  6165.   }
  6166. ***************
  6167. *** 969,978 ****
  6168.   **    Parameters:
  6169.   **        h -- the header field to output.
  6170.   **        p -- the value to put in it.
  6171. - **        fp -- file to put it to.
  6172.   **        oldstyle -- TRUE if this is an old style header.
  6173. ! **        m -- a pointer to the mailer descriptor.  If NULL,
  6174. ! **            don't transform the name at all.
  6175.   **        e -- the envelope containing the message.
  6176.   **
  6177.   **    Returns:
  6178. --- 1006,1013 ----
  6179.   **    Parameters:
  6180.   **        h -- the header field to output.
  6181.   **        p -- the value to put in it.
  6182.   **        oldstyle -- TRUE if this is an old style header.
  6183. ! **        mci -- the connection information.
  6184.   **        e -- the envelope containing the message.
  6185.   **
  6186.   **    Returns:
  6187. ***************
  6188. *** 982,997 ****
  6189.   **        outputs "p" to file "fp".
  6190.   */
  6191.   
  6192. ! commaize(h, p, fp, oldstyle, m, e)
  6193.       register HDR *h;
  6194.       register char *p;
  6195. -     FILE *fp;
  6196.       bool oldstyle;
  6197. !     register MAILER *m;
  6198.       register ENVELOPE *e;
  6199.   {
  6200.       register char *obp;
  6201.       int opos;
  6202.       bool firstone = TRUE;
  6203.       char obuf[MAXLINE + 3];
  6204.   
  6205. --- 1017,1033 ----
  6206.   **        outputs "p" to file "fp".
  6207.   */
  6208.   
  6209. ! void
  6210. ! commaize(h, p, oldstyle, mci, e)
  6211.       register HDR *h;
  6212.       register char *p;
  6213.       bool oldstyle;
  6214. !     register MCI *mci;
  6215.       register ENVELOPE *e;
  6216.   {
  6217.       register char *obp;
  6218.       int opos;
  6219. +     int omax;
  6220.       bool firstone = TRUE;
  6221.       char obuf[MAXLINE + 3];
  6222.   
  6223. ***************
  6224. *** 1007,1012 ****
  6225. --- 1043,1051 ----
  6226.       (void) sprintf(obp, "%s: ", h->h_field);
  6227.       opos = strlen(h->h_field) + 2;
  6228.       obp += opos;
  6229. +     omax = mci->mci_mailer->m_linelimit - 2;
  6230. +     if (omax < 0 || omax > 78)
  6231. +         omax = 78;
  6232.   
  6233.       /*
  6234.       **  Run through the list of values.
  6235. ***************
  6236. *** 1070,1076 ****
  6237.           if (bitset(H_FROM, h->h_flags))
  6238.               flags |= RF_SENDERADDR;
  6239.           stat = EX_OK;
  6240. !         name = remotename(name, m, flags, &stat, e);
  6241.           if (*name == '\0')
  6242.           {
  6243.               *p = savechar;
  6244. --- 1109,1115 ----
  6245.           if (bitset(H_FROM, h->h_flags))
  6246.               flags |= RF_SENDERADDR;
  6247.           stat = EX_OK;
  6248. !         name = remotename(name, mci->mci_mailer, flags, &stat, e);
  6249.           if (*name == '\0')
  6250.           {
  6251.               *p = savechar;
  6252. ***************
  6253. *** 1081,1092 ****
  6254.           opos += strlen(name);
  6255.           if (!firstone)
  6256.               opos += 2;
  6257. !         if (opos > 78 && !firstone)
  6258.           {
  6259.               (void) strcpy(obp, ",\n");
  6260. !             putline(obuf, fp, m);
  6261.               obp = obuf;
  6262. !             (void) sprintf(obp, "        ");
  6263.               opos = strlen(obp);
  6264.               obp += opos;
  6265.               opos += strlen(name);
  6266. --- 1120,1131 ----
  6267.           opos += strlen(name);
  6268.           if (!firstone)
  6269.               opos += 2;
  6270. !         if (opos > omax && !firstone)
  6271.           {
  6272.               (void) strcpy(obp, ",\n");
  6273. !             putline(obuf, mci);
  6274.               obp = obuf;
  6275. !             (void) strcpy(obp, "        ");
  6276.               opos = strlen(obp);
  6277.               obp += opos;
  6278.               opos += strlen(name);
  6279. ***************
  6280. *** 1093,1099 ****
  6281.           }
  6282.           else if (!firstone)
  6283.           {
  6284. !             (void) sprintf(obp, ", ");
  6285.               obp += 2;
  6286.           }
  6287.   
  6288. --- 1132,1138 ----
  6289.           }
  6290.           else if (!firstone)
  6291.           {
  6292. !             (void) strcpy(obp, ", ");
  6293.               obp += 2;
  6294.           }
  6295.   
  6296. ***************
  6297. *** 1103,1109 ****
  6298.           *p = savechar;
  6299.       }
  6300.       (void) strcpy(obp, "\n");
  6301. !     putline(obuf, fp, m);
  6302.   }
  6303.    /*
  6304.   **  COPYHEADER -- copy header list
  6305. --- 1142,1148 ----
  6306.           *p = savechar;
  6307.       }
  6308.       (void) strcpy(obp, "\n");
  6309. !     putline(obuf, mci);
  6310.   }
  6311.    /*
  6312.   **  COPYHEADER -- copy header list
  6313. *** src/macro.c.OLD    Thu Jul 29 08:33:17 1993
  6314. --- src/macro.c    Mon Feb  7 08:31:23 1994
  6315. ***************
  6316. *** 33,39 ****
  6317.    */
  6318.   
  6319.   #ifndef lint
  6320. ! static char sccsid[] = "@(#)macro.c    8.2 (Berkeley) 7/29/93";
  6321.   #endif /* not lint */
  6322.   
  6323.   # include "sendmail.h"
  6324. --- 33,39 ----
  6325.    */
  6326.   
  6327.   #ifndef lint
  6328. ! static char sccsid[] = "@(#)macro.c    8.3 (Berkeley) 2/7/94";
  6329.   #endif /* not lint */
  6330.   
  6331.   # include "sendmail.h"
  6332. ***************
  6333. *** 115,122 ****
  6334.               continue;
  6335.   
  6336.             case MACROEXPAND:    /* macro interpolation */
  6337. !             c = *++s;
  6338. !             q = macvalue(c & 0177, e);
  6339.               if (q == NULL)
  6340.                   continue;
  6341.               break;
  6342. --- 115,128 ----
  6343.               continue;
  6344.   
  6345.             case MACROEXPAND:    /* macro interpolation */
  6346. !             c = *++s & 0177;
  6347. !             if (c != '\0')
  6348. !                 q = macvalue(c, e);
  6349. !             else
  6350. !             {
  6351. !                 s--;
  6352. !                 q = NULL;
  6353. !             }
  6354.               if (q == NULL)
  6355.                   continue;
  6356.               break;
  6357. *** src/mailq.1.OLD    Wed Feb  2 05:41:50 1994
  6358. --- src/mailq.1    Tue Feb 22 11:27:02 1994
  6359. ***************
  6360. *** 0 ****
  6361. --- 1,88 ----
  6362. + .\" Copyright (c) 1985, 1990, 1993
  6363. + .\"    The Regents of the University of California.  All rights reserved.
  6364. + .\"
  6365. + .\" Redistribution and use in source and binary forms, with or without
  6366. + .\" modification, are permitted provided that the following conditions
  6367. + .\" are met:
  6368. + .\" 1. Redistributions of source code must retain the above copyright
  6369. + .\"    notice, this list of conditions and the following disclaimer.
  6370. + .\" 2. Redistributions in binary form must reproduce the above copyright
  6371. + .\"    notice, this list of conditions and the following disclaimer in the
  6372. + .\"    documentation and/or other materials provided with the distribution.
  6373. + .\" 3. All advertising materials mentioning features or use of this software
  6374. + .\"    must display the following acknowledgement:
  6375. + .\"    This product includes software developed by the University of
  6376. + .\"    California, Berkeley and its contributors.
  6377. + .\" 4. Neither the name of the University nor the names of its contributors
  6378. + .\"    may be used to endorse or promote products derived from this software
  6379. + .\"    without specific prior written permission.
  6380. + .\"
  6381. + .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  6382. + .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  6383. + .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  6384. + .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  6385. + .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  6386. + .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  6387. + .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  6388. + .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  6389. + .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  6390. + .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  6391. + .\" SUCH DAMAGE.
  6392. + .\"
  6393. + .\"     @(#)mailq.1    8.4 (Berkeley) 2/22/94
  6394. + .\"
  6395. + .Dd February 22, 1994
  6396. + .Dt MAILQ 1
  6397. + .Os BSD 4
  6398. + .Sh NAME
  6399. + .Nm mailq
  6400. + .Nd print the mail queue
  6401. + .Sh SYNOPSIS
  6402. + .Nm mailq
  6403. + .Op Fl v
  6404. + .Sh DESCRIPTION
  6405. + .Nm Mailq
  6406. + prints a summary of the mail messages queued for future delivery.
  6407. + .Pp
  6408. + The first line printed for each message
  6409. + shows the internal identifier used on this host
  6410. + for the message,
  6411. + the size of the message in bytes,
  6412. + the date and time the message was accepted into the queue,
  6413. + and the envelope sender of the message.
  6414. + The second line shows the error message that caused this message
  6415. + to be retained in the queue;
  6416. + it will not be present if the message is being processed
  6417. + for the first time.
  6418. + The following lines show message recipients,
  6419. + one per line.
  6420. + .Pp
  6421. + .Nm Mailq
  6422. + is identical to
  6423. + .Dq Li "sendmail -bp" .
  6424. + .Pp
  6425. + The options are as follows:
  6426. + .Bl -tag -width Ds
  6427. + .It Fl v
  6428. + Print verbose information.
  6429. + This adds the priority of the message and
  6430. + a single character indicator (``+'' or blank)
  6431. + indicating whether a warning message has been sent
  6432. + on the first line of the message.
  6433. + Additionally, extra lines may be intermixed with the recipients
  6434. + indicating the ``controlling user'' information;
  6435. + this shows who will own any programs that are executed
  6436. + on behalf of this message
  6437. + and the name of the alias this command expanded from, if any.
  6438. + .El
  6439. + .Pp
  6440. + The
  6441. + .Nm mailq
  6442. + utility exits 0 on success, and >0 if an error occurs.
  6443. + .Sh SEE ALSO
  6444. + .Xr sendmail 8
  6445. + .Sh HISTORY
  6446. + The
  6447. + .Nm mailq
  6448. + command appeared in
  6449. + .Bx 4.0 .
  6450. *** src/main.c.OLD    Sun Jan  9 11:09:20 1994
  6451. --- src/main.c    Fri Mar 11 14:42:20 1994
  6452. ***************
  6453. *** 39,52 ****
  6454.   #endif /* not lint */
  6455.   
  6456.   #ifndef lint
  6457. ! static char sccsid[] = "@(#)main.c    8.46 (Berkeley) 1/9/94";
  6458.   #endif /* not lint */
  6459.   
  6460.   #define    _DEFINE
  6461.   
  6462.   #include "sendmail.h"
  6463. ! #include <sgtty.h>
  6464. ! #ifdef NAMED_BIND
  6465.   #include <arpa/nameser.h>
  6466.   #include <resolv.h>
  6467.   #endif
  6468. --- 39,51 ----
  6469.   #endif /* not lint */
  6470.   
  6471.   #ifndef lint
  6472. ! static char sccsid[] = "@(#)main.c    8.52 (Berkeley) 3/11/94";
  6473.   #endif /* not lint */
  6474.   
  6475.   #define    _DEFINE
  6476.   
  6477.   #include "sendmail.h"
  6478. ! #if NAMED_BIND
  6479.   #include <arpa/nameser.h>
  6480.   #include <resolv.h>
  6481.   #endif
  6482. ***************
  6483. *** 321,327 ****
  6484.       OpMode = MD_DELIVER;
  6485.       FullName = getenv("NAME");
  6486.   
  6487. ! #ifdef NAMED_BIND
  6488.       if (tTd(8, 8))
  6489.           _res.options |= RES_DEBUG;
  6490.   #endif
  6491. --- 320,326 ----
  6492.       OpMode = MD_DELIVER;
  6493.       FullName = getenv("NAME");
  6494.   
  6495. ! #if NAMED_BIND
  6496.       if (tTd(8, 8))
  6497.           _res.options |= RES_DEBUG;
  6498.   #endif
  6499. ***************
  6500. *** 443,448 ****
  6501. --- 442,450 ----
  6502.                 case MD_TEST:
  6503.                 case MD_INITALIAS:
  6504.                 case MD_PRINT:
  6505. + #ifdef MAYBE_NEXT_RELEASE
  6506. +               case MD_ARPAFTP:
  6507. + #endif
  6508.                   OpMode = j;
  6509.                   break;
  6510.   
  6511. ***************
  6512. *** 708,720 ****
  6513.           /* remove things that don't make sense in daemon mode */
  6514.           FullName = NULL;
  6515.           break;
  6516. -       case MD_SMTP:
  6517. -         if (RealUid != 0)
  6518. -             auth_warning(CurEnv,
  6519. -                 "%s owned process doing -bs",
  6520. -                 RealUserName);
  6521. -         break;
  6522.       }
  6523.   
  6524.       /* do heuristic mode adjustment */
  6525. --- 710,715 ----
  6526. ***************
  6527. *** 1297,1302 ****
  6528. --- 1292,1298 ----
  6529.       HoldErrs = TRUE;
  6530.       CurEnv->e_errormode = EM_MAIL;
  6531.       Verbose = FALSE;
  6532. +     DisConnected = TRUE;
  6533.   
  6534.       /* all input from /dev/null */
  6535.       if (InChannel != stdin)
  6536. ***************
  6537. *** 1360,1366 ****
  6538.           /* skip over options that do have a value */
  6539.           op = strchr(OPTIONS, ap[1]);
  6540.           if (op != NULL && *++op == ':' && ap[2] == '\0' &&
  6541. !             argv[1] != NULL && argv[1][0] != '-')
  6542.           {
  6543.               argv++;
  6544.               continue;
  6545. --- 1356,1362 ----
  6546.           /* skip over options that do have a value */
  6547.           op = strchr(OPTIONS, ap[1]);
  6548.           if (op != NULL && *++op == ':' && ap[2] == '\0' &&
  6549. !             ap[1] != 'd' && argv[1] != NULL && argv[1][0] != '-')
  6550.           {
  6551.               argv++;
  6552.               continue;
  6553. *** src/makesendmail.OLD    Sun Sep 26 11:38:49 1993
  6554. --- src/makesendmail    Sun Feb 27 11:51:26 1994
  6555. ***************
  6556. *** 32,38 ****
  6557.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  6558.   # SUCH DAMAGE.
  6559.   #
  6560. ! #       @(#)makesendmail    8.3 (Berkeley) 9/26/93
  6561.   #
  6562.   
  6563.   #
  6564. --- 32,38 ----
  6565.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  6566.   # SUCH DAMAGE.
  6567.   #
  6568. ! #       @(#)makesendmail    8.5 (Berkeley) 2/27/94
  6569.   #
  6570.   
  6571.   #
  6572. ***************
  6573. *** 45,50 ****
  6574. --- 45,52 ----
  6575.   case $arch
  6576.   in
  6577.     sun4*)    arch=sun4;;
  6578. +   9000/*)    arch=`echo $arch | sed -e 's/9000.//' -e 's/..$/xx/'`;;
  6579.   esac
  6580.   
  6581.   # determine operating system type
  6582. ***************
  6583. *** 52,67 ****
  6584. --- 54,76 ----
  6585.   
  6586.   # determine operating system release
  6587.   rel=`uname -r`
  6588. + rbase=`echo $rel | sed 's/\..*//''`
  6589.   
  6590.   # now try to find a reasonable object directory
  6591.   if [ -r obj.$os.$arch.$rel ]; then
  6592.       obj=obj.$os.$arch.$rel
  6593. + elif [ -r obj.$os.$arch.$rbase.x ]; then
  6594. +     obj=obj.$os.$arch.$rbase.x
  6595.   elif [ -r obj.$os.$rel ]; then
  6596.       obj=obj.$os.$rel
  6597. + elif [ -r obj.$os.$rbase.x ]; then
  6598. +     obj=obj.$os.$rbase.x
  6599.   elif [ -r obj.$os.$arch ]; then
  6600.       obj=obj.$os.$arch
  6601.   elif [ -r obj.$arch.$rel ]; then
  6602.       obj=obj.$arch.$rel
  6603. + elif [ -r obj.$arch.$rbase.x ]; then
  6604. +     obj=obj.$arch.$rbase.x
  6605.   elif [ -r obj.$os ]; then
  6606.       obj=obj.$os
  6607.   elif [ -r obj.$arch ]; then
  6608. ***************
  6609. *** 68,82 ****
  6610.       obj=obj.$arch
  6611.   elif [ -r obj.$rel ]; then
  6612.       obj=obj.$rel
  6613. ! elif [ -r Makefile.$os ]; then
  6614.       obj=obj.$os.$arch.$rel
  6615. !     echo "Creating $obj using Makefile.$os"
  6616.       mkdir $obj
  6617. !     (cd $obj; ln -s ../*.[ch158] ../sendmail.hf .; ln -s ../Makefile.$os Makefile)
  6618. ! else
  6619. !     echo "Warning: no recognized support for $arch.$os.$rel"
  6620. !     echo "    ... winging it ..."
  6621. !     obj=.
  6622.   fi
  6623.   echo "Making in $obj"
  6624.   cd $obj
  6625. --- 77,112 ----
  6626.       obj=obj.$arch
  6627.   elif [ -r obj.$rel ]; then
  6628.       obj=obj.$rel
  6629. ! else
  6630. !     # no existing obj directory -- try to create one if Makefile found
  6631.       obj=obj.$os.$arch.$rel
  6632. !     if [ -r Makefile.$os.$arch.$rel ]; then
  6633. !         makefile=Makefile.$os.$arch.$rel
  6634. !     elif [ -r Makefile.$os.$arch.$rbase.x ]; then
  6635. !         makefile=Makefile.$os.$arch.$rbase.x
  6636. !     elif [ -r Makefile.$os.$rel ]; then
  6637. !         makefile=Makefile.$os.$rel
  6638. !     elif [ -r Makefile.$os.$rbase.x ]; then
  6639. !         makefile=Makefile.$os.$rbase.x
  6640. !     elif [ -r Makefile.$os.$arch ]; then
  6641. !         makefile=Makefile.$os.$arch
  6642. !     elif [ -r Makefile.$arch.$rel ]; then
  6643. !         makefile=Makefile.$arch.$rel
  6644. !     elif [ -r Makefile.$arch.$rbase.x ]; then
  6645. !         makefile=Makefile.$arch.$rbase.x
  6646. !     elif [ -r Makefile.$os ]; then
  6647. !         makefile=Makefile.$os
  6648. !     elif [ -r Makefile.$arch ]; then
  6649. !         makefile=Makefile.$arch
  6650. !     elif [ -r Makefile.$rel ]; then
  6651. !         makefile=Makefile.$rel
  6652. !     else
  6653. !         echo "Cannot determine how to support $arch.$os.$rel"
  6654. !         exit 1
  6655. !     fi
  6656. !     echo "Creating $obj using $makefile"
  6657.       mkdir $obj
  6658. !     (cd $obj; ln -s ../*.[ch158] ../sendmail.hf .; ln -s ../$makefile Makefile)
  6659.   fi
  6660.   echo "Making in $obj"
  6661.   cd $obj
  6662. *** src/map.c.OLD    Sat Dec 11 08:26:17 1993
  6663. --- src/map.c    Fri Feb 18 13:00:48 1994
  6664. ***************
  6665. *** 33,39 ****
  6666.    */
  6667.   
  6668.   #ifndef lint
  6669. ! static char sccsid[] = "@(#)map.c    8.20 (Berkeley) 12/11/93";
  6670.   #endif /* not lint */
  6671.   
  6672.   #include "sendmail.h"
  6673. --- 33,39 ----
  6674.    */
  6675.   
  6676.   #ifndef lint
  6677. ! static char sccsid[] = "@(#)map.c    8.22 (Berkeley) 2/18/94";
  6678.   #endif /* not lint */
  6679.   
  6680.   #include "sendmail.h"
  6681. ***************
  6682. *** 638,644 ****
  6683.       if (omode == O_RDWR)
  6684.       {
  6685.           omode |= O_CREAT|O_TRUNC;
  6686. ! #if defined(O_EXLOCK) && defined(HASFLOCK)
  6687.           omode |= O_EXLOCK;
  6688.   # if !defined(OLD_NEWDB)
  6689.       }
  6690. --- 638,644 ----
  6691.       if (omode == O_RDWR)
  6692.       {
  6693.           omode |= O_CREAT|O_TRUNC;
  6694. ! #if defined(O_EXLOCK) && HASFLOCK
  6695.           omode |= O_EXLOCK;
  6696.   # if !defined(OLD_NEWDB)
  6697.       }
  6698. ***************
  6699. *** 664,670 ****
  6700.               syserr("Cannot open BTREE database %s", map->map_file);
  6701.           return FALSE;
  6702.       }
  6703. ! #if !defined(OLD_NEWDB) && defined(HASFLOCK)
  6704.       fd = db->fd(db);
  6705.   # if !defined(O_EXLOCK)
  6706.       if (mode == O_RDWR && fd >= 0)
  6707. --- 664,670 ----
  6708.               syserr("Cannot open BTREE database %s", map->map_file);
  6709.           return FALSE;
  6710.       }
  6711. ! #if !defined(OLD_NEWDB) && HASFLOCK
  6712.       fd = db->fd(db);
  6713.   # if !defined(O_EXLOCK)
  6714.       if (mode == O_RDWR && fd >= 0)
  6715. ***************
  6716. *** 722,728 ****
  6717.       if (omode == O_RDWR)
  6718.       {
  6719.           omode |= O_CREAT|O_TRUNC;
  6720. ! #if defined(O_EXLOCK) && defined(HASFLOCK)
  6721.           omode |= O_EXLOCK;
  6722.   # if !defined(OLD_NEWDB)
  6723.       }
  6724. --- 722,728 ----
  6725.       if (omode == O_RDWR)
  6726.       {
  6727.           omode |= O_CREAT|O_TRUNC;
  6728. ! #if defined(O_EXLOCK) && HASFLOCK
  6729.           omode |= O_EXLOCK;
  6730.   # if !defined(OLD_NEWDB)
  6731.       }
  6732. ***************
  6733. *** 748,754 ****
  6734.               syserr("Cannot open HASH database %s", map->map_file);
  6735.           return FALSE;
  6736.       }
  6737. ! #if !defined(OLD_NEWDB) && defined(HASFLOCK)
  6738.       fd = db->fd(db);
  6739.   # if !defined(O_EXLOCK)
  6740.       if (mode == O_RDWR && fd >= 0)
  6741. --- 748,754 ----
  6742.               syserr("Cannot open HASH database %s", map->map_file);
  6743.           return FALSE;
  6744.       }
  6745. ! #if !defined(OLD_NEWDB) && HASFLOCK
  6746.       fd = db->fd(db);
  6747.   # if !defined(O_EXLOCK)
  6748.       if (mode == O_RDWR && fd >= 0)
  6749. ***************
  6750. *** 965,975 ****
  6751.               map->map_domain = p;
  6752.       }
  6753.   
  6754. -     if (map->map_domain == NULL)
  6755. -         yp_get_default_domain(&map->map_domain);
  6756.       if (*map->map_file == '\0')
  6757.           map->map_file = "mail.aliases";
  6758.   
  6759.       /* check to see if this map actually exists */
  6760.       yperr = yp_match(map->map_domain, map->map_file, "@", 1,
  6761. --- 965,983 ----
  6762.               map->map_domain = p;
  6763.       }
  6764.   
  6765.       if (*map->map_file == '\0')
  6766.           map->map_file = "mail.aliases";
  6767. +     if (map->map_domain == NULL)
  6768. +     {
  6769. +         yperr = yp_get_default_domain(&map->map_domain);
  6770. +         if (yperr != 0)
  6771. +         {
  6772. +             syserr("NIS map %s specified, but NIS not running\n",
  6773. +                 map->map_file);
  6774. +             return FALSE;
  6775. +         }
  6776. +     }
  6777.   
  6778.       /* check to see if this map actually exists */
  6779.       yperr = yp_match(map->map_domain, map->map_file, "@", 1,
  6780. *** src/mci.c.OLD    Wed Dec  1 14:01:45 1993
  6781. --- src/mci.c    Wed Feb  9 07:40:15 1994
  6782. ***************
  6783. *** 33,39 ****
  6784.    */
  6785.   
  6786.   #ifndef lint
  6787. ! static char sccsid[] = "@(#)mci.c    8.9 (Berkeley) 12/1/93";
  6788.   #endif /* not lint */
  6789.   
  6790.   #include "sendmail.h"
  6791. --- 33,39 ----
  6792.    */
  6793.   
  6794.   #ifndef lint
  6795. ! static char sccsid[] = "@(#)mci.c    8.12 (Berkeley) 2/9/94";
  6796.   #endif /* not lint */
  6797.   
  6798.   #include "sendmail.h"
  6799. ***************
  6800. *** 275,280 ****
  6801. --- 275,283 ----
  6802.       bzero(&CurHostAddr, sizeof CurHostAddr);
  6803.   #endif
  6804.   
  6805. +     /* clear out any expired connections */
  6806. +     mci_scan(NULL);
  6807.       if (m->m_mno < 0)
  6808.           syserr("negative mno %d (%s)", m->m_mno, m->m_name);
  6809.       s = stab(host, ST_MCI + m->m_mno, ST_ENTER);
  6810. ***************
  6811. *** 300,305 ****
  6812. --- 303,323 ----
  6813.               mci->mci_exitstat = EX_OK;
  6814.               mci->mci_state = MCIS_CLOSED;
  6815.           }
  6816. +         else
  6817. +         {
  6818. +             /* get peer host address for logging reasons only */
  6819. +             /* (this should really be in the mci struct) */
  6820. +             int socksize = sizeof CurHostAddr;
  6821. +             (void) getpeername(fileno(mci->mci_in),
  6822. +                 (struct sockaddr *) &CurHostAddr, &socksize);
  6823. +         }
  6824. +     }
  6825. +     if (mci->mci_state == MCIS_CLOSED)
  6826. +     {
  6827. +         /* copy out any mailer flags needed in connection state */
  6828. +         if (bitnset(M_7BITS, m->m_flags))
  6829. +             mci->mci_flags |= MCIF_7BIT;
  6830.       }
  6831.   
  6832.       return mci;
  6833. *** src/newaliases.1.OLD    Thu Dec 30 15:41:57 1993
  6834. --- src/newaliases.1    Tue Feb 22 11:27:02 1994
  6835. ***************
  6836. *** 29,37 ****
  6837.   .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  6838.   .\" SUCH DAMAGE.
  6839.   .\"
  6840. ! .\"     @(#)newaliases.1    8.1 (Berkeley) 6/7/93
  6841.   .\"
  6842. ! .Dd June 7, 1993
  6843.   .Dt NEWALIASES 1
  6844.   .Os BSD 4
  6845.   .Sh NAME
  6846. --- 29,37 ----
  6847.   .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  6848.   .\" SUCH DAMAGE.
  6849.   .\"
  6850. ! .\"     @(#)newaliases.1    8.4 (Berkeley) 2/22/94
  6851.   .\"
  6852. ! .Dd February 22, 1994
  6853.   .Dt NEWALIASES 1
  6854.   .Os BSD 4
  6855.   .Sh NAME
  6856. ***************
  6857. *** 43,54 ****
  6858.   .Nm Newaliases
  6859.   rebuilds the random access data base for the mail aliases file
  6860.   .Pa /etc/aliases .
  6861. ! It must be run each time
  6862. ! .Pa /etc/aliases
  6863. ! is changed in order
  6864.   for the change to take effect.
  6865.   .Sh SEE ALSO
  6866. ! .\" .Xr aliases 5 ,
  6867.   .Xr sendmail 8
  6868.   .Sh HISTORY
  6869.   The
  6870. --- 43,65 ----
  6871.   .Nm Newaliases
  6872.   rebuilds the random access data base for the mail aliases file
  6873.   .Pa /etc/aliases .
  6874. ! It must be run each time this file is changed in order
  6875.   for the change to take effect.
  6876. + .Pp
  6877. + .Nm Newaliases
  6878. + is identical to
  6879. + .Dq Li "sendmail -bi" .
  6880. + .Pp
  6881. + The
  6882. + .Nm newaliases
  6883. + utility exits 0 on success, and >0 if an error occurs.
  6884. + .Sh FILES
  6885. + .Bl -tag -width /etc/aliases -compact
  6886. + .It Pa /etc/aliases
  6887. + The mail aliases file
  6888. + .El
  6889.   .Sh SEE ALSO
  6890. ! .Xr aliases 5 ,
  6891.   .Xr sendmail 8
  6892.   .Sh HISTORY
  6893.   The
  6894. *** src/parseaddr.c.OLD    Wed Jan  5 09:20:14 1994
  6895. --- src/parseaddr.c    Wed Feb  9 11:32:30 1994
  6896. ***************
  6897. *** 33,39 ****
  6898.    */
  6899.   
  6900.   #ifndef lint
  6901. ! static char sccsid[] = "@(#)parseaddr.c    8.29 (Berkeley) 1/5/94";
  6902.   #endif /* not lint */
  6903.   
  6904.   # include "sendmail.h"
  6905. --- 33,39 ----
  6906.    */
  6907.   
  6908.   #ifndef lint
  6909. ! static char sccsid[] = "@(#)parseaddr.c    8.30 (Berkeley) 2/9/94";
  6910.   #endif /* not lint */
  6911.   
  6912.   # include "sendmail.h"
  6913. ***************
  6914. *** 1331,1337 ****
  6915.           }
  6916.           else
  6917.           {
  6918. !             usrerr("%s", buf);
  6919.           }
  6920.           goto badaddr;
  6921.       }
  6922. --- 1331,1337 ----
  6923.           }
  6924.           else
  6925.           {
  6926. !             usrerr("553 %s", buf);
  6927.           }
  6928.           goto badaddr;
  6929.       }
  6930. *** src/queue.c.OLD    Sun Jan  9 09:22:40 1994
  6931. --- src/queue.c    Sun Mar  6 09:00:40 1994
  6932. ***************
  6933. *** 36,44 ****
  6934.   
  6935.   #ifndef lint
  6936.   #ifdef QUEUE
  6937. ! static char sccsid[] = "@(#)queue.c    8.36 (Berkeley) 1/9/94 (with queueing)";
  6938.   #else
  6939. ! static char sccsid[] = "@(#)queue.c    8.36 (Berkeley) 1/9/94 (without queueing)";
  6940.   #endif
  6941.   #endif /* not lint */
  6942.   
  6943. --- 36,44 ----
  6944.   
  6945.   #ifndef lint
  6946.   #ifdef QUEUE
  6947. ! static char sccsid[] = "@(#)queue.c    8.40 (Berkeley) 3/6/94 (with queueing)";
  6948.   #else
  6949. ! static char sccsid[] = "@(#)queue.c    8.40 (Berkeley) 3/6/94 (without queueing)";
  6950.   #endif
  6951.   #endif /* not lint */
  6952.   
  6953. ***************
  6954. *** 94,99 ****
  6955. --- 94,100 ----
  6956.       bool newid;
  6957.       register char *p;
  6958.       MAILER nullmailer;
  6959. +     MCI mcibuf;
  6960.       char buf[MAXLINE], tf[MAXLINE];
  6961.   
  6962.       /*
  6963. ***************
  6964. *** 182,188 ****
  6965.           if (fd < 0 || (dfp = fdopen(fd, "w")) == NULL)
  6966.               syserr("!queueup: cannot create data temp file %s, uid=%d",
  6967.                   e->e_df, geteuid());
  6968. !         (*e->e_putbody)(dfp, FileMailer, e, NULL);
  6969.           (void) xfclose(dfp, "queueup dfp", e->e_id);
  6970.           e->e_putbody = putbody;
  6971.       }
  6972. --- 183,192 ----
  6973.           if (fd < 0 || (dfp = fdopen(fd, "w")) == NULL)
  6974.               syserr("!queueup: cannot create data temp file %s, uid=%d",
  6975.                   e->e_df, geteuid());
  6976. !         bzero(&mcibuf, sizeof mcibuf);
  6977. !         mcibuf.mci_out = dfp;
  6978. !         mcibuf.mci_mailer = FileMailer;
  6979. !         (*e->e_putbody)(&mcibuf, e, NULL);
  6980.           (void) xfclose(dfp, "queueup dfp", e->e_id);
  6981.           e->e_putbody = putbody;
  6982.       }
  6983. ***************
  6984. *** 278,283 ****
  6985. --- 282,290 ----
  6986.       nullmailer.m_re_rwset = nullmailer.m_rh_rwset =
  6987.               nullmailer.m_se_rwset = nullmailer.m_sh_rwset = -1;
  6988.       nullmailer.m_eol = "\n";
  6989. +     bzero(&mcibuf, sizeof mcibuf);
  6990. +     mcibuf.mci_mailer = &nullmailer;
  6991. +     mcibuf.mci_out = tfp;
  6992.   
  6993.       define('g', "\201f", e);
  6994.       for (h = e->e_header; h != NULL; h = h->h_link)
  6995. ***************
  6996. *** 330,337 ****
  6997.               if (bitset(H_FROM, h->h_flags))
  6998.                   oldstyle = FALSE;
  6999.   
  7000. !             commaize(h, h->h_value, tfp, oldstyle,
  7001. !                  &nullmailer, e);
  7002.   
  7003.               TrafficLogFile = savetrace;
  7004.           }
  7005. --- 337,343 ----
  7006.               if (bitset(H_FROM, h->h_flags))
  7007.                   oldstyle = FALSE;
  7008.   
  7009. !             commaize(h, h->h_value, oldstyle, &mcibuf, e);
  7010.   
  7011.               TrafficLogFile = savetrace;
  7012.           }
  7013. ***************
  7014. *** 565,571 ****
  7015.   
  7016.               pid = dowork(w->w_name + 2, ForkQueueRuns, FALSE, e);
  7017.               errno = 0;
  7018. !             (void) waitfor(pid);
  7019.           }
  7020.           free(w->w_name);
  7021.           free((char *) w);
  7022. --- 571,578 ----
  7023.   
  7024.               pid = dowork(w->w_name + 2, ForkQueueRuns, FALSE, e);
  7025.               errno = 0;
  7026. !             if (pid != 0)
  7027. !                 (void) waitfor(pid);
  7028.           }
  7029.           free(w->w_name);
  7030.           free((char *) w);
  7031. ***************
  7032. *** 891,896 ****
  7033. --- 898,904 ----
  7034.           e->e_errormode = EM_MAIL;
  7035.           e->e_id = id;
  7036.           GrabTo = UseErrorsTo = FALSE;
  7037. +         ExitStat = EX_OK;
  7038.           if (forkflag)
  7039.           {
  7040.               disconnect(1, e);
  7041. ***************
  7042. *** 913,919 ****
  7043.               if (forkflag)
  7044.                   exit(EX_OK);
  7045.               else
  7046. !                 return;
  7047.           }
  7048.   
  7049.           e->e_flags |= EF_INQUEUE;
  7050. --- 921,927 ----
  7051.               if (forkflag)
  7052.                   exit(EX_OK);
  7053.               else
  7054. !                 return 0;
  7055.           }
  7056.   
  7057.           e->e_flags |= EF_INQUEUE;
  7058. ***************
  7059. *** 1135,1141 ****
  7060.               break;
  7061.   
  7062.             default:
  7063. !             syserr("readqf: %s: line %s: bad line \"%s\"",
  7064.                   qf, LineNumber, bp);
  7065.               fclose(qfp);
  7066.               rename(qf, queuename(e, 'Q'));
  7067. --- 1143,1149 ----
  7068.               break;
  7069.   
  7070.             default:
  7071. !             syserr("readqf: %s: line %d: bad line \"%s\"",
  7072.                   qf, LineNumber, bp);
  7073.               fclose(qfp);
  7074.               rename(qf, queuename(e, 'Q'));
  7075. ***************
  7076. *** 1539,1545 ****
  7077.           *p++ = '\0';
  7078.       if (*user != '\0' && (pw = getpwnam(user)) != NULL)
  7079.       {
  7080. !         a->q_home = newstr(pw->pw_dir);
  7081.           a->q_uid = pw->pw_uid;
  7082.           a->q_gid = pw->pw_gid;
  7083.           a->q_user = newstr(user);
  7084. --- 1547,1556 ----
  7085.           *p++ = '\0';
  7086.       if (*user != '\0' && (pw = getpwnam(user)) != NULL)
  7087.       {
  7088. !         if (strcmp(pw->pw_dir, "/") == 0)
  7089. !             a->q_home = "";
  7090. !         else
  7091. !             a->q_home = newstr(pw->pw_dir);
  7092.           a->q_uid = pw->pw_uid;
  7093.           a->q_gid = pw->pw_gid;
  7094.           a->q_user = newstr(user);
  7095. *** src/readcf.c.OLD    Sun Jan  9 09:00:09 1994
  7096. --- src/readcf.c    Fri Mar 11 14:42:19 1994
  7097. ***************
  7098. *** 33,45 ****
  7099.    */
  7100.   
  7101.   #ifndef lint
  7102. ! static char sccsid[] = "@(#)readcf.c    8.18 (Berkeley) 1/9/94";
  7103.   #endif /* not lint */
  7104.   
  7105.   # include "sendmail.h"
  7106.   # include <pwd.h>
  7107.   # include <grp.h>
  7108. ! #ifdef NAMED_BIND
  7109.   # include <arpa/nameser.h>
  7110.   # include <resolv.h>
  7111.   #endif
  7112. --- 33,45 ----
  7113.    */
  7114.   
  7115.   #ifndef lint
  7116. ! static char sccsid[] = "@(#)readcf.c    8.22 (Berkeley) 3/11/94";
  7117.   #endif /* not lint */
  7118.   
  7119.   # include "sendmail.h"
  7120.   # include <pwd.h>
  7121.   # include <grp.h>
  7122. ! #if NAMED_BIND
  7123.   # include <arpa/nameser.h>
  7124.   # include <resolv.h>
  7125.   #endif
  7126. ***************
  7127. *** 221,227 ****
  7128.   
  7129.               if (*p == '\0')
  7130.               {
  7131. !                 syserr("invalid rewrite line \"%s\"", bp);
  7132.                   break;
  7133.               }
  7134.   
  7135. --- 221,227 ----
  7136.   
  7137.               if (*p == '\0')
  7138.               {
  7139. !                 syserr("invalid rewrite line \"%s\" (tab expected)", bp);
  7140.                   break;
  7141.               }
  7142.   
  7143. ***************
  7144. *** 542,548 ****
  7145.       {
  7146.           /* user didn't initialize: set up host map */
  7147.           strcpy(buf, "host host");
  7148. ! #ifdef NAMED_BIND
  7149.           if (ConfigLevel >= 2)
  7150.               strcat(buf, " -a.");
  7151.   #endif
  7152. --- 542,548 ----
  7153.       {
  7154.           /* user didn't initialize: set up host map */
  7155.           strcpy(buf, "host host");
  7156. ! #if NAMED_BIND
  7157.           if (ConfigLevel >= 2)
  7158.               strcat(buf, " -a.");
  7159.   #endif
  7160. ***************
  7161. *** 600,607 ****
  7162. --- 600,618 ----
  7163.       struct stat stbuf;
  7164.       char buf[MAXLINE];
  7165.   
  7166. +     if (tTd(37, 2))
  7167. +         printf("fileclass(%s, fmt=%s)\n", filename, fmt);
  7168. +     if (filename[0] == '|')
  7169. +     {
  7170. +         syserr("fileclass: pipes (F%c%s) not supported due to security problems",
  7171. +             class, filename);
  7172. +         return;
  7173. +     }
  7174.       if (stat(filename, &stbuf) < 0)
  7175.       {
  7176. +         if (tTd(37, 2))
  7177. +             printf("  cannot stat (%s)\n", errstring(errno));
  7178.           if (!optional)
  7179.               syserr("fileclass: cannot stat %s", filename);
  7180.           return;
  7181. ***************
  7182. *** 659,666 ****
  7183.                   *p++ = '\0';
  7184.   
  7185.               /* enter the word in the symbol table */
  7186. !             s = stab(q, ST_CLASS, ST_ENTER);
  7187. !             setbitn(class, s->s_class);
  7188.           }
  7189.       }
  7190.   
  7191. --- 670,676 ----
  7192.                   *p++ = '\0';
  7193.   
  7194.               /* enter the word in the symbol table */
  7195. !             setclass(class, q);
  7196.           }
  7197.       }
  7198.   
  7199. ***************
  7200. *** 1007,1013 ****
  7201.   static BITMAP    StickyOpt;        /* set if option is stuck */
  7202.   
  7203.   
  7204. ! #ifdef NAMED_BIND
  7205.   
  7206.   struct resolverflags
  7207.   {
  7208. --- 1017,1023 ----
  7209.   static BITMAP    StickyOpt;        /* set if option is stuck */
  7210.   
  7211.   
  7212. ! #if NAMED_BIND
  7213.   
  7214.   struct resolverflags
  7215.   {
  7216. ***************
  7217. *** 1216,1222 ****
  7218.           break;
  7219.   
  7220.         case 'I':        /* use internet domain name server */
  7221. ! #ifdef NAMED_BIND
  7222.           UseNameServer = TRUE;
  7223.           for (p = val; *p != 0; )
  7224.           {
  7225. --- 1226,1232 ----
  7226.           break;
  7227.   
  7228.         case 'I':        /* use internet domain name server */
  7229. ! #if NAMED_BIND
  7230.           UseNameServer = TRUE;
  7231.           for (p = val; *p != 0; )
  7232.           {
  7233. *** src/recipient.c.OLD    Mon Jan 10 08:57:26 1994
  7234. --- src/recipient.c    Mon Feb 28 10:04:57 1994
  7235. ***************
  7236. *** 33,39 ****
  7237.    */
  7238.   
  7239.   #ifndef lint
  7240. ! static char sccsid[] = "@(#)recipient.c    8.39 (Berkeley) 1/10/94";
  7241.   #endif /* not lint */
  7242.   
  7243.   # include "sendmail.h"
  7244. --- 33,39 ----
  7245.    */
  7246.   
  7247.   #ifndef lint
  7248. ! static char sccsid[] = "@(#)recipient.c    8.44 (Berkeley) 2/28/94";
  7249.   #endif /* not lint */
  7250.   
  7251.   # include "sendmail.h"
  7252. ***************
  7253. *** 307,314 ****
  7254.               {
  7255.   #ifdef LOG
  7256.                   if (LogLevel > 2)
  7257. !                     syslog(LOG_ERR, "%s: include %s: transient error: %e",
  7258. !                         e->e_id, a->q_user, errstring(ret));
  7259.   #endif
  7260.                   a->q_flags |= QQUEUEUP;
  7261.                   a->q_flags &= ~QDONTSEND;
  7262. --- 307,315 ----
  7263.               {
  7264.   #ifdef LOG
  7265.                   if (LogLevel > 2)
  7266. !                     syslog(LOG_ERR, "%s: include %s: transient error: %s",
  7267. !                         e->e_id == NULL ? "NOQUEUE" : e->e_id,
  7268. !                         a->q_user, errstring(ret));
  7269.   #endif
  7270.                   a->q_flags |= QQUEUEUP;
  7271.                   a->q_flags &= ~QDONTSEND;
  7272. ***************
  7273. *** 376,382 ****
  7274.   # ifdef LOG
  7275.               if (LogLevel > 8)
  7276.                   syslog(LOG_INFO, "%s: deferred: udbexpand: %s",
  7277. !                     e->e_id, errstring(errno));
  7278.   # endif
  7279.               message("queued (user database error): %s",
  7280.                   errstring(errno));
  7281. --- 377,384 ----
  7282.   # ifdef LOG
  7283.               if (LogLevel > 8)
  7284.                   syslog(LOG_INFO, "%s: deferred: udbexpand: %s",
  7285. !                     e->e_id == NULL ? "NOQUEUE" : e->e_id,
  7286. !                     errstring(errno));
  7287.   # endif
  7288.               message("queued (user database error): %s",
  7289.                   errstring(errno));
  7290. ***************
  7291. *** 447,453 ****
  7292.                   (void) strcpy(buf, pw->pw_name);
  7293.                   goto trylocaluser;
  7294.               }
  7295. !             a->q_home = newstr(pw->pw_dir);
  7296.               a->q_uid = pw->pw_uid;
  7297.               a->q_gid = pw->pw_gid;
  7298.               a->q_ruser = newstr(pw->pw_name);
  7299. --- 449,458 ----
  7300.                   (void) strcpy(buf, pw->pw_name);
  7301.                   goto trylocaluser;
  7302.               }
  7303. !             if (strcmp(pw->pw_dir, "/") == 0)
  7304. !                 a->q_home = "";
  7305. !             else
  7306. !                 a->q_home = newstr(pw->pw_dir);
  7307.               a->q_uid = pw->pw_uid;
  7308.               a->q_gid = pw->pw_gid;
  7309.               a->q_ruser = newstr(pw->pw_name);
  7310. ***************
  7311. *** 719,724 ****
  7312. --- 724,742 ----
  7313.   **    Side Effects:
  7314.   **        reads the :include: file and sends to everyone
  7315.   **        listed in that file.
  7316. + **
  7317. + **    Security Note:
  7318. + **        If you have restricted chown (that is, you can't
  7319. + **        give a file away), it is reasonable to allow programs
  7320. + **        and files called from this :include: file to be to be
  7321. + **        run as the owner of the :include: file.  This is bogus
  7322. + **        if there is any chance of someone giving away a file.
  7323. + **        We assume that pre-POSIX systems can give away files.
  7324. + **
  7325. + **        There is an additional restriction that if you
  7326. + **        forward to a :include: file, it will not take on
  7327. + **        the ownership of the :include: file.  This may not
  7328. + **        be necessary, but shouldn't hurt.
  7329.   */
  7330.   
  7331.   static jmp_buf    CtxIncludeTimeout;
  7332. ***************
  7333. *** 750,755 ****
  7334. --- 768,791 ----
  7335.       int sfflags = forwarding ? SFF_MUSTOWN : SFF_ANYFILE;
  7336.       struct stat st;
  7337.       char buf[MAXLINE];
  7338. + #ifdef _POSIX_CHOWN_RESTRICTED
  7339. + # if _POSIX_CHOWN_RESTRICTED == -1
  7340. + #  define safechown    FALSE
  7341. + # else
  7342. + #  define safechown    TRUE
  7343. + # endif
  7344. + #else
  7345. + # ifdef _PC_CHOWN_RESTRICTED
  7346. +     bool safechown;
  7347. + # else
  7348. + #  ifdef BSD
  7349. + #   define safechown    TRUE
  7350. + #  else
  7351. + #   define safechown    FALSE
  7352. + #  endif
  7353. + # endif
  7354. + #endif
  7355. +     extern bool chownsafe();
  7356.   
  7357.       if (tTd(27, 2))
  7358.           printf("include(%s)\n", fname);
  7359. ***************
  7360. *** 858,864 ****
  7361.           return rval;
  7362.       }
  7363.   
  7364. !     if (ca == NULL)
  7365.       {
  7366.           ctladdr->q_uid = st.st_uid;
  7367.           ctladdr->q_gid = st.st_gid;
  7368. --- 894,903 ----
  7369.           return rval;
  7370.       }
  7371.   
  7372. ! #ifndef safechown
  7373. !     safechown = chownsafe(fileno(fp));
  7374. ! #endif
  7375. !     if (ca == NULL && safechown)
  7376.       {
  7377.           ctladdr->q_uid = st.st_uid;
  7378.           ctladdr->q_gid = st.st_gid;
  7379. ***************
  7380. *** 872,884 ****
  7381.       }
  7382.       else
  7383.       {
  7384.           register struct passwd *pw;
  7385.   
  7386.           pw = getpwuid(st.st_uid);
  7387. !         if (pw == NULL || !usershellok(pw->pw_shell))
  7388.           {
  7389.               ctladdr->q_ruser = newstr(pw->pw_name);
  7390.               ctladdr->q_flags |= QBOGUSSHELL;
  7391.           }
  7392.       }
  7393.   
  7394. --- 911,935 ----
  7395.       }
  7396.       else
  7397.       {
  7398. +         char *sh;
  7399.           register struct passwd *pw;
  7400.   
  7401. +         sh = "/SENDMAIL/ANY/SHELL/";
  7402.           pw = getpwuid(st.st_uid);
  7403. !         if (pw != NULL)
  7404.           {
  7405.               ctladdr->q_ruser = newstr(pw->pw_name);
  7406. +             if (safechown)
  7407. +                 sh = pw->pw_shell;
  7408. +         }
  7409. +         if (pw == NULL)
  7410.               ctladdr->q_flags |= QBOGUSSHELL;
  7411. +         else if(!usershellok(sh))
  7412. +         {
  7413. +             if (safechown)
  7414. +                 ctladdr->q_flags |= QBOGUSSHELL;
  7415. +             else
  7416. +                 ctladdr->q_flags |= QUNSAFEADDR;
  7417.           }
  7418.       }
  7419.   
  7420. ***************
  7421. *** 924,930 ****
  7422.   #ifdef LOG
  7423.           if (forwarding && LogLevel > 9)
  7424.               syslog(LOG_INFO, "%s: forward %s => %s",
  7425. !                 e->e_id, oldto, buf);
  7426.   #endif
  7427.   
  7428.           AliasLevel++;
  7429. --- 975,982 ----
  7430.   #ifdef LOG
  7431.           if (forwarding && LogLevel > 9)
  7432.               syslog(LOG_INFO, "%s: forward %s => %s",
  7433. !                 e->e_id == NULL ? "NOQUEUE" : e->e_id,
  7434. !                 oldto, buf);
  7435.   #endif
  7436.   
  7437.           AliasLevel++;
  7438. *** src/savemail.c.OLD    Sat Dec 18 06:25:06 1993
  7439. --- src/savemail.c    Fri Mar 11 14:42:18 1994
  7440. ***************
  7441. *** 33,39 ****
  7442.    */
  7443.   
  7444.   #ifndef lint
  7445. ! static char sccsid[] = "@(#)savemail.c    8.24 (Berkeley) 12/18/93";
  7446.   #endif /* not lint */
  7447.   
  7448.   # include "sendmail.h"
  7449. --- 33,39 ----
  7450.    */
  7451.   
  7452.   #ifndef lint
  7453. ! static char sccsid[] = "@(#)savemail.c    8.28 (Berkeley) 3/11/94";
  7454.   #endif /* not lint */
  7455.   
  7456.   # include "sendmail.h"
  7457. ***************
  7458. *** 81,89 ****
  7459.       register FILE *fp;
  7460.       int state;
  7461.       auto ADDRESS *q = NULL;
  7462.       char buf[MAXLINE+1];
  7463.       extern struct passwd *getpwnam();
  7464. -     register char *p;
  7465.       extern char *ttypath();
  7466.       typedef int (*fnptr)();
  7467.       extern bool writable();
  7468. --- 81,90 ----
  7469.       register FILE *fp;
  7470.       int state;
  7471.       auto ADDRESS *q = NULL;
  7472. +     register char *p;
  7473. +     MCI mcibuf;
  7474.       char buf[MAXLINE+1];
  7475.       extern struct passwd *getpwnam();
  7476.       extern char *ttypath();
  7477.       typedef int (*fnptr)();
  7478.       extern bool writable();
  7479. ***************
  7480. *** 90,97 ****
  7481.   
  7482.       if (tTd(6, 1))
  7483.       {
  7484. !         printf("\nsavemail, errormode = %c, id = %s\n  e_from=",
  7485. !             e->e_errormode, e->e_id == NULL ? "NONE" : e->e_id);
  7486.           printaddr(&e->e_from, FALSE);
  7487.       }
  7488.   
  7489. --- 91,99 ----
  7490.   
  7491.       if (tTd(6, 1))
  7492.       {
  7493. !         printf("\nsavemail, errormode = %c, id = %s, ExitStat = %d\n  e_from=",
  7494. !             e->e_errormode, e->e_id == NULL ? "NONE" : e->e_id,
  7495. !             ExitStat);
  7496.           printaddr(&e->e_from, FALSE);
  7497.       }
  7498.   
  7499. ***************
  7500. *** 282,289 ****
  7501.                   state = ESM_POSTMASTER;
  7502.                   break;
  7503.               }
  7504. !             if (returntosender(e->e_message,
  7505. !                        q, (e->e_class >= 0), e) == 0)
  7506.               {
  7507.                   state = ESM_DONE;
  7508.                   break;
  7509. --- 284,291 ----
  7510.                   state = ESM_POSTMASTER;
  7511.                   break;
  7512.               }
  7513. !             if (returntosender(e->e_message, e->e_errorqueue,
  7514. !                        (e->e_class >= 0), e) == 0)
  7515.               {
  7516.                   state = ESM_DONE;
  7517.                   break;
  7518. ***************
  7519. *** 393,403 ****
  7520.                   break;
  7521.               }
  7522.   
  7523. !             putfromline(fp, FileMailer, e);
  7524. !             (*e->e_puthdr)(fp, FileMailer, e);
  7525. !             putline("\n", fp, FileMailer);
  7526. !             (*e->e_putbody)(fp, FileMailer, e, NULL);
  7527. !             putline("\n", fp, FileMailer);
  7528.               (void) fflush(fp);
  7529.               state = ferror(fp) ? ESM_PANIC : ESM_DONE;
  7530.               (void) xfclose(fp, "savemail", "/usr/tmp/dead.letter");
  7531. --- 395,411 ----
  7532.                   break;
  7533.               }
  7534.   
  7535. !             bzero(&mcibuf, sizeof mcibuf);
  7536. !             mcibuf.mci_out = fp;
  7537. !             mcibuf.mci_mailer = FileMailer;
  7538. !             if (bitnset(M_7BITS, FileMailer->m_flags))
  7539. !                 mcibuf.mci_flags |= MCIF_7BIT;
  7540. !             putfromline(&mcibuf, e);
  7541. !             (*e->e_puthdr)(&mcibuf, e);
  7542. !             putline("\n", &mcibuf);
  7543. !             (*e->e_putbody)(&mcibuf, e, NULL);
  7544. !             putline("\n", &mcibuf);
  7545.               (void) fflush(fp);
  7546.               state = ferror(fp) ? ESM_PANIC : ESM_DONE;
  7547.               (void) xfclose(fp, "savemail", "/usr/tmp/dead.letter");
  7548. ***************
  7549. *** 564,571 ****
  7550.   **    original offending message.
  7551.   **
  7552.   **    Parameters:
  7553. ! **        fp -- the output file.
  7554. ! **        m -- the mailer to output to.
  7555.   **        e -- the envelope we are working in.
  7556.   **
  7557.   **    Returns:
  7558. --- 572,578 ----
  7559.   **    original offending message.
  7560.   **
  7561.   **    Parameters:
  7562. ! **        mci -- the mailer connection information.
  7563.   **        e -- the envelope we are working in.
  7564.   **
  7565.   **    Returns:
  7566. ***************
  7567. *** 575,583 ****
  7568.   **        Outputs the body of an error message.
  7569.   */
  7570.   
  7571. ! errbody(fp, m, e)
  7572. !     register FILE *fp;
  7573. !     register struct mailer *m;
  7574.       register ENVELOPE *e;
  7575.   {
  7576.       register FILE *xfile;
  7577. --- 582,589 ----
  7578.   **        Outputs the body of an error message.
  7579.   */
  7580.   
  7581. ! errbody(mci, e)
  7582. !     register MCI *mci;
  7583.       register ENVELOPE *e;
  7584.   {
  7585.       register FILE *xfile;
  7586. ***************
  7587. *** 589,595 ****
  7588.       if (e->e_parent == NULL)
  7589.       {
  7590.           syserr("errbody: null parent");
  7591. !         putline("   ----- Original message lost -----\n", fp, m);
  7592.           return;
  7593.       }
  7594.   
  7595. --- 595,601 ----
  7596.       if (e->e_parent == NULL)
  7597.       {
  7598.           syserr("errbody: null parent");
  7599. !         putline("   ----- Original message lost -----\n", mci);
  7600.           return;
  7601.       }
  7602.   
  7603. ***************
  7604. *** 599,609 ****
  7605.   
  7606.       if (e->e_msgboundary != NULL)
  7607.       {
  7608. !         putline("This is a MIME-encapsulated message", fp, m);
  7609. !         putline("", fp, m);
  7610.           (void) sprintf(buf, "--%s", e->e_msgboundary);
  7611. !         putline(buf, fp, m);
  7612. !         putline("", fp, m);
  7613.       }
  7614.   
  7615.       /*
  7616. --- 605,615 ----
  7617.   
  7618.       if (e->e_msgboundary != NULL)
  7619.       {
  7620. !         putline("This is a MIME-encapsulated message", mci);
  7621. !         putline("", mci);
  7622.           (void) sprintf(buf, "--%s", e->e_msgboundary);
  7623. !         putline(buf, mci);
  7624. !         putline("", mci);
  7625.       }
  7626.   
  7627.       /*
  7628. ***************
  7629. *** 617,637 ****
  7630.           !bitset(EF_FATALERRS|EF_SENDRECEIPT, e->e_parent->e_flags))
  7631.       {
  7632.           putline("    **********************************************",
  7633. !             fp, m);
  7634.           putline("    **      THIS IS A WARNING MESSAGE ONLY      **",
  7635. !             fp, m);
  7636.           putline("    **  YOU DO NOT NEED TO RESEND YOUR MESSAGE  **",
  7637. !             fp, m);
  7638.           putline("    **********************************************",
  7639. !             fp, m);
  7640. !         putline("", fp, m);
  7641.       }
  7642.       sprintf(buf, "The original message was received at %s",
  7643.           arpadate(ctime(&e->e_parent->e_ctime)));
  7644. !     putline(buf, fp, m);
  7645.       expand("from \201_", buf, &buf[sizeof buf - 1], e->e_parent);
  7646. !     putline(buf, fp, m);
  7647. !     putline("", fp, m);
  7648.   
  7649.       /*
  7650.       **  Output error message header (if specified and available).
  7651. --- 623,643 ----
  7652.           !bitset(EF_FATALERRS|EF_SENDRECEIPT, e->e_parent->e_flags))
  7653.       {
  7654.           putline("    **********************************************",
  7655. !             mci);
  7656.           putline("    **      THIS IS A WARNING MESSAGE ONLY      **",
  7657. !             mci);
  7658.           putline("    **  YOU DO NOT NEED TO RESEND YOUR MESSAGE  **",
  7659. !             mci);
  7660.           putline("    **********************************************",
  7661. !             mci);
  7662. !         putline("", mci);
  7663.       }
  7664.       sprintf(buf, "The original message was received at %s",
  7665.           arpadate(ctime(&e->e_parent->e_ctime)));
  7666. !     putline(buf, mci);
  7667.       expand("from \201_", buf, &buf[sizeof buf - 1], e->e_parent);
  7668. !     putline(buf, mci);
  7669. !     putline("", mci);
  7670.   
  7671.       /*
  7672.       **  Output error message header (if specified and available).
  7673. ***************
  7674. *** 647,663 ****
  7675.                   while (fgets(buf, sizeof buf, xfile) != NULL)
  7676.                   {
  7677.                       expand(buf, buf, &buf[sizeof buf - 1], e);
  7678. !                     putline(buf, fp, m);
  7679.                   }
  7680.                   (void) fclose(xfile);
  7681. !                 putline("\n", fp, m);
  7682.               }
  7683.           }
  7684.           else
  7685.           {
  7686.               expand(ErrMsgFile, buf, &buf[sizeof buf - 1], e);
  7687. !             putline(buf, fp, m);
  7688. !             putline("", fp, m);
  7689.           }
  7690.       }
  7691.   
  7692. --- 653,669 ----
  7693.                   while (fgets(buf, sizeof buf, xfile) != NULL)
  7694.                   {
  7695.                       expand(buf, buf, &buf[sizeof buf - 1], e);
  7696. !                     putline(buf, mci);
  7697.                   }
  7698.                   (void) fclose(xfile);
  7699. !                 putline("\n", mci);
  7700.               }
  7701.           }
  7702.           else
  7703.           {
  7704.               expand(ErrMsgFile, buf, &buf[sizeof buf - 1], e);
  7705. !             putline(buf, mci);
  7706. !             putline("", mci);
  7707.           }
  7708.       }
  7709.   
  7710. ***************
  7711. *** 673,679 ****
  7712.               if (printheader)
  7713.               {
  7714.                   putline("   ----- The following addresses had delivery problems -----",
  7715. !                     fp, m);
  7716.                   printheader = FALSE;
  7717.               }
  7718.               strcpy(buf, q->q_paddr);
  7719. --- 679,685 ----
  7720.               if (printheader)
  7721.               {
  7722.                   putline("   ----- The following addresses had delivery problems -----",
  7723. !                     mci);
  7724.                   printheader = FALSE;
  7725.               }
  7726.               strcpy(buf, q->q_paddr);
  7727. ***************
  7728. *** 681,698 ****
  7729.                   strcat(buf, "  (unrecoverable error)");
  7730.               else
  7731.                   strcat(buf, "  (transient failure)");
  7732. !             putline(buf, fp, m);
  7733.               if (q->q_alias != NULL)
  7734.               {
  7735.                   strcpy(buf, "    (expanded from: ");
  7736.                   strcat(buf, q->q_alias->q_paddr);
  7737.                   strcat(buf, ")");
  7738. !                 putline(buf, fp, m);
  7739.               }
  7740.           }
  7741.       }
  7742.       if (!printheader)
  7743. !         putline("\n", fp, m);
  7744.   
  7745.       /*
  7746.       **  Output transcript of errors
  7747. --- 687,704 ----
  7748.                   strcat(buf, "  (unrecoverable error)");
  7749.               else
  7750.                   strcat(buf, "  (transient failure)");
  7751. !             putline(buf, mci);
  7752.               if (q->q_alias != NULL)
  7753.               {
  7754.                   strcpy(buf, "    (expanded from: ");
  7755.                   strcat(buf, q->q_alias->q_paddr);
  7756.                   strcat(buf, ")");
  7757. !                 putline(buf, mci);
  7758.               }
  7759.           }
  7760.       }
  7761.       if (!printheader)
  7762. !         putline("\n", mci);
  7763.   
  7764.       /*
  7765.       **  Output transcript of errors
  7766. ***************
  7767. *** 703,717 ****
  7768.       if ((xfile = fopen(p, "r")) == NULL)
  7769.       {
  7770.           syserr("Cannot open %s", p);
  7771. !         putline("   ----- Transcript of session is unavailable -----\n", fp, m);
  7772.       }
  7773.       else
  7774.       {
  7775. !         putline("   ----- Transcript of session follows -----\n", fp, m);
  7776.           if (e->e_xfp != NULL)
  7777.               (void) fflush(e->e_xfp);
  7778.           while (fgets(buf, sizeof buf, xfile) != NULL)
  7779. !             putline(buf, fp, m);
  7780.           (void) xfclose(xfile, "errbody xscript", p);
  7781.       }
  7782.       errno = 0;
  7783. --- 709,723 ----
  7784.       if ((xfile = fopen(p, "r")) == NULL)
  7785.       {
  7786.           syserr("Cannot open %s", p);
  7787. !         putline("   ----- Transcript of session is unavailable -----\n", mci);
  7788.       }
  7789.       else
  7790.       {
  7791. !         putline("   ----- Transcript of session follows -----\n", mci);
  7792.           if (e->e_xfp != NULL)
  7793.               (void) fflush(e->e_xfp);
  7794.           while (fgets(buf, sizeof buf, xfile) != NULL)
  7795. !             putline(buf, mci);
  7796.           (void) xfclose(xfile, "errbody xscript", p);
  7797.       }
  7798.       errno = 0;
  7799. ***************
  7800. *** 722,763 ****
  7801.   
  7802.       if (NoReturn)
  7803.           SendBody = FALSE;
  7804. !     putline("", fp, m);
  7805.       if (e->e_parent->e_df != NULL)
  7806.       {
  7807.           if (SendBody)
  7808. !             putline("   ----- Original message follows -----\n", fp, m);
  7809.           else
  7810. !             putline("   ----- Message header follows -----\n", fp, m);
  7811. !         (void) fflush(fp);
  7812.   
  7813.           if (e->e_msgboundary != NULL)
  7814.           {
  7815. !             putline("", fp, m);
  7816.               (void) sprintf(buf, "--%s", e->e_msgboundary);
  7817. !             putline(buf, fp, m);
  7818. !             putline("Content-Type: message/rfc822", fp, m);
  7819. !             putline("", fp, m);
  7820.           }
  7821. !         putheader(fp, m, e->e_parent);
  7822. !         putline("", fp, m);
  7823.           if (SendBody)
  7824. !             putbody(fp, m, e->e_parent, e->e_msgboundary);
  7825.           else
  7826. !             putline("   ----- Message body suppressed -----", fp, m);
  7827.       }
  7828.       else
  7829.       {
  7830. !         putline("  ----- No message was collected -----\n", fp, m);
  7831.       }
  7832.   
  7833.       if (e->e_msgboundary != NULL)
  7834.       {
  7835. !         putline("", fp, m);
  7836.           (void) sprintf(buf, "--%s--", e->e_msgboundary);
  7837. !         putline(buf, fp, m);
  7838.       }
  7839. !     putline("", fp, m);
  7840.   
  7841.       /*
  7842.       **  Cleanup and exit
  7843. --- 728,769 ----
  7844.   
  7845.       if (NoReturn)
  7846.           SendBody = FALSE;
  7847. !     putline("", mci);
  7848.       if (e->e_parent->e_df != NULL)
  7849.       {
  7850.           if (SendBody)
  7851. !             putline("   ----- Original message follows -----\n", mci);
  7852.           else
  7853. !             putline("   ----- Message header follows -----\n", mci);
  7854. !         (void) fflush(mci->mci_out);
  7855.   
  7856.           if (e->e_msgboundary != NULL)
  7857.           {
  7858. !             putline("", mci);
  7859.               (void) sprintf(buf, "--%s", e->e_msgboundary);
  7860. !             putline(buf, mci);
  7861. !             putline("Content-Type: message/rfc822", mci);
  7862. !             putline("", mci);
  7863.           }
  7864. !         putheader(mci, e->e_parent);
  7865. !         putline("", mci);
  7866.           if (SendBody)
  7867. !             putbody(mci, e->e_parent, e->e_msgboundary);
  7868.           else
  7869. !             putline("   ----- Message body suppressed -----", mci);
  7870.       }
  7871.       else
  7872.       {
  7873. !         putline("  ----- No message was collected -----\n", mci);
  7874.       }
  7875.   
  7876.       if (e->e_msgboundary != NULL)
  7877.       {
  7878. !         putline("", mci);
  7879.           (void) sprintf(buf, "--%s--", e->e_msgboundary);
  7880. !         putline(buf, mci);
  7881.       }
  7882. !     putline("", mci);
  7883.   
  7884.       /*
  7885.       **  Cleanup and exit
  7886. ***************
  7887. *** 786,792 ****
  7888.   pruneroute(addr)
  7889.       char *addr;
  7890.   {
  7891. ! #ifdef NAMED_BIND
  7892.       char *start, *at, *comma;
  7893.       char c;
  7894.       int rcode;
  7895. --- 792,798 ----
  7896.   pruneroute(addr)
  7897.       char *addr;
  7898.   {
  7899. ! #if NAMED_BIND
  7900.       char *start, *at, *comma;
  7901.       char c;
  7902.       int rcode;
  7903. *** src/sendmail.h.OLD    Wed Jan  5 08:34:35 1994
  7904. --- src/sendmail.h    Sun Feb  6 14:07:22 1994
  7905. ***************
  7906. *** 31,37 ****
  7907.    * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  7908.    * SUCH DAMAGE.
  7909.    *
  7910. !  *    @(#)sendmail.h    8.38 (Berkeley) 1/5/94
  7911.    */
  7912.   
  7913.   /*
  7914. --- 31,37 ----
  7915.    * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  7916.    * SUCH DAMAGE.
  7917.    *
  7918. !  *    @(#)sendmail.h    8.41 (Berkeley) 2/6/94
  7919.    */
  7920.   
  7921.   /*
  7922. ***************
  7923. *** 41,47 ****
  7924.   # ifdef _DEFINE
  7925.   # define EXTERN
  7926.   # ifndef lint
  7927. ! static char SmailSccsId[] =    "@(#)sendmail.h    8.38        1/5/94";
  7928.   # endif
  7929.   # else /*  _DEFINE */
  7930.   # define EXTERN extern
  7931. --- 41,47 ----
  7932.   # ifdef _DEFINE
  7933.   # define EXTERN
  7934.   # ifndef lint
  7935. ! static char SmailSccsId[] =    "@(#)sendmail.h    8.41        2/6/94";
  7936.   # endif
  7937.   # else /*  _DEFINE */
  7938.   # define EXTERN extern
  7939. ***************
  7940. *** 268,273 ****
  7941. --- 268,317 ----
  7942.   # define H_RECEIPTTO    02000    /* this field has return receipt info */
  7943.   # define H_ERRORSTO    04000    /* this field has error address info */
  7944.    /*
  7945. + **  Information about currently open connections to mailers, or to
  7946. + **  hosts that we have looked up recently.
  7947. + */
  7948. + # define MCI        struct mailer_con_info
  7949. + MCI
  7950. + {
  7951. +     short        mci_flags;    /* flag bits, see below */
  7952. +     short        mci_errno;    /* error number on last connection */
  7953. +     short        mci_herrno;    /* h_errno from last DNS lookup */
  7954. +     short        mci_exitstat;    /* exit status from last connection */
  7955. +     short        mci_state;    /* SMTP state */
  7956. +     long        mci_maxsize;    /* max size this server will accept */
  7957. +     FILE        *mci_in;    /* input side of connection */
  7958. +     FILE        *mci_out;    /* output side of connection */
  7959. +     int        mci_pid;    /* process id of subordinate proc */
  7960. +     char        *mci_phase;    /* SMTP phase string */
  7961. +     struct mailer    *mci_mailer;    /* ptr to the mailer for this conn */
  7962. +     char        *mci_host;    /* host name */
  7963. +     time_t        mci_lastuse;    /* last usage time */
  7964. + };
  7965. + /* flag bits */
  7966. + #define MCIF_VALID    000001        /* this entry is valid */
  7967. + #define MCIF_TEMP    000002        /* don't cache this connection */
  7968. + #define MCIF_CACHED    000004        /* currently in open cache */
  7969. + #define MCIF_ESMTP    000010        /* this host speaks ESMTP */
  7970. + #define MCIF_EXPN    000020        /* EXPN command supported */
  7971. + #define MCIF_SIZE    000040        /* SIZE option supported */
  7972. + #define MCIF_8BITMIME    000100        /* BODY=8BITMIME supported */
  7973. + #define MCIF_7BIT    000200        /* strip this message to 7 bits */
  7974. + #define MCIF_MULTSTAT    000400        /* MAIL11V3: handles MULT status */
  7975. + /* states */
  7976. + #define MCIS_CLOSED    0        /* no traffic on this connection */
  7977. + #define MCIS_OPENING    1        /* sending initial protocol */
  7978. + #define MCIS_OPEN    2        /* open, initial protocol sent */
  7979. + #define MCIS_ACTIVE    3        /* message being sent */
  7980. + #define MCIS_QUITING    4        /* running quit protocol */
  7981. + #define MCIS_SSD    5        /* service shutting down */
  7982. + #define MCIS_ERROR    6        /* I/O error on connection */
  7983. +  /*
  7984.   **  Envelope structure.
  7985.   **    This structure defines the message itself.  There is usually
  7986.   **    only one of these -- for the message that we originally read
  7987. ***************
  7988. *** 298,306 ****
  7989.       short        e_nsent;    /* number of sends since checkpoint */
  7990.       short        e_sendmode;    /* message send mode */
  7991.       short        e_errormode;    /* error return mode */
  7992. !     int        (*e_puthdr)__P((FILE *, MAILER *, ENVELOPE *));
  7993.                       /* function to put header of message */
  7994. !     int        (*e_putbody)__P((FILE *, MAILER *, ENVELOPE *, char *));
  7995.                       /* function to put body of message */
  7996.       struct envelope    *e_parent;    /* the message this one encloses */
  7997.       struct envelope *e_sibling;    /* the next envelope of interest */
  7998. --- 342,350 ----
  7999.       short        e_nsent;    /* number of sends since checkpoint */
  8000.       short        e_sendmode;    /* message send mode */
  8001.       short        e_errormode;    /* error return mode */
  8002. !     int        (*e_puthdr)__P((MCI *, ENVELOPE *));
  8003.                       /* function to put header of message */
  8004. !     int        (*e_putbody)__P((MCI *, ENVELOPE *, char *));
  8005.                       /* function to put body of message */
  8006.       struct envelope    *e_parent;    /* the message this one encloses */
  8007.       struct envelope *e_sibling;    /* the next envelope of interest */
  8008. ***************
  8009. *** 429,477 ****
  8010.       u_char    metaval;    /* internal code (as above) */
  8011.   };
  8012.    /*
  8013. - **  Information about currently open connections to mailers, or to
  8014. - **  hosts that we have looked up recently.
  8015. - */
  8016. - # define MCI    struct mailer_con_info
  8017. - MCI
  8018. - {
  8019. -     short        mci_flags;    /* flag bits, see below */
  8020. -     short        mci_errno;    /* error number on last connection */
  8021. -     short        mci_herrno;    /* h_errno from last DNS lookup */
  8022. -     short        mci_exitstat;    /* exit status from last connection */
  8023. -     short        mci_state;    /* SMTP state */
  8024. -     long        mci_maxsize;    /* max size this server will accept */
  8025. -     FILE        *mci_in;    /* input side of connection */
  8026. -     FILE        *mci_out;    /* output side of connection */
  8027. -     int        mci_pid;    /* process id of subordinate proc */
  8028. -     char        *mci_phase;    /* SMTP phase string */
  8029. -     struct mailer    *mci_mailer;    /* ptr to the mailer for this conn */
  8030. -     char        *mci_host;    /* host name */
  8031. -     time_t        mci_lastuse;    /* last usage time */
  8032. - };
  8033. - /* flag bits */
  8034. - #define MCIF_VALID    000001        /* this entry is valid */
  8035. - #define MCIF_TEMP    000002        /* don't cache this connection */
  8036. - #define MCIF_CACHED    000004        /* currently in open cache */
  8037. - #define MCIF_ESMTP    000010        /* this host speaks ESMTP */
  8038. - #define MCIF_EXPN    000020        /* EXPN command supported */
  8039. - #define MCIF_SIZE    000040        /* SIZE option supported */
  8040. - #define MCIF_8BITMIME    000100        /* BODY=8BITMIME supported */
  8041. - #define MCIF_MULTSTAT    000200        /* MAIL11V3: handles MULT status */
  8042. - /* states */
  8043. - #define MCIS_CLOSED    0        /* no traffic on this connection */
  8044. - #define MCIS_OPENING    1        /* sending initial protocol */
  8045. - #define MCIS_OPEN    2        /* open, initial protocol sent */
  8046. - #define MCIS_ACTIVE    3        /* message being sent */
  8047. - #define MCIS_QUITING    4        /* running quit protocol */
  8048. - #define MCIS_SSD    5        /* service shutting down */
  8049. - #define MCIS_ERROR    6        /* I/O error on connection */
  8050. -  /*
  8051.   **  Name canonification short circuit.
  8052.   **
  8053.   **    If the name server for a host is down, the process of trying to
  8054. --- 473,478 ----
  8055. ***************
  8056. *** 660,665 ****
  8057. --- 661,667 ----
  8058.   
  8059.   #define MD_DELIVER    'm'        /* be a mail sender */
  8060.   #define MD_SMTP        's'        /* run SMTP on standard input */
  8061. + #define MD_ARPAFTP    'a'        /* obsolete ARPANET mode (Grey Book) */
  8062.   #define MD_DAEMON    'd'        /* run as a daemon */
  8063.   #define MD_VERIFY    'v'        /* verify: don't collect or deliver */
  8064.   #define MD_TEST        't'        /* test mode: resolve addrs only */
  8065. ***************
  8066. *** 824,829 ****
  8067. --- 826,832 ----
  8068.   EXTERN bool    TryNullMXList;    /* if we are the best MX, try host directly */
  8069.   extern bool    CheckLoopBack;    /* check for loopback on HELO packet */
  8070.   EXTERN bool    InChild;    /* true if running in an SMTP subprocess */
  8071. + EXTERN bool    DisConnected;    /* running with OutChannel redirected to xf */
  8072.   EXTERN char    SpaceSub;    /* substitution for <lwsp> */
  8073.   EXTERN int    PrivacyFlags;    /* privacy flags */
  8074.   EXTERN char    *ConfFile;    /* location of configuration file [conf.c] */
  8075. ***************
  8076. *** 950,955 ****
  8077. --- 953,959 ----
  8078.   extern sigfunc_t    setsignal __P((int, sigfunc_t));
  8079.   extern char        *shortenstring __P((char *, int));
  8080.   extern bool        usershellok __P((char *));
  8081. + extern void        commaize __P((HDR *, char *, int, MCI *, ENVELOPE *));
  8082.   
  8083.   /* ellipsis is a different case though */
  8084.   #ifdef __STDC__
  8085. *** src/srvrsmtp.c.OLD    Wed Dec 22 05:07:01 1993
  8086. --- src/srvrsmtp.c    Tue Mar  8 10:32:21 1994
  8087. ***************
  8088. *** 36,44 ****
  8089.   
  8090.   #ifndef lint
  8091.   #ifdef SMTP
  8092. ! static char sccsid[] = "@(#)srvrsmtp.c    8.23 (Berkeley) 12/21/93 (with SMTP)";
  8093.   #else
  8094. ! static char sccsid[] = "@(#)srvrsmtp.c    8.23 (Berkeley) 12/21/93 (without SMTP)";
  8095.   #endif
  8096.   #endif /* not lint */
  8097.   
  8098. --- 36,44 ----
  8099.   
  8100.   #ifndef lint
  8101.   #ifdef SMTP
  8102. ! static char sccsid[] = "@(#)srvrsmtp.c    8.32 (Berkeley) 3/8/94 (with SMTP)";
  8103.   #else
  8104. ! static char sccsid[] = "@(#)srvrsmtp.c    8.32 (Berkeley) 3/8/94 (without SMTP)";
  8105.   #endif
  8106.   #endif /* not lint */
  8107.   
  8108. ***************
  8109. *** 117,123 ****
  8110. --- 117,127 ----
  8111.   char    *CurSmtpClient;            /* who's at the other end of channel */
  8112.   
  8113.   static char    *skipword();
  8114. + extern char    RealUserName[];
  8115.   
  8116. + #define MAXBADCOMMANDS    25        /* maximum number of bad commands */
  8117.   smtp(e)
  8118.       register ENVELOPE *e;
  8119.   {
  8120. ***************
  8121. *** 132,141 ****
  8122. --- 136,147 ----
  8123.       char *protocol;            /* sending protocol */
  8124.       char *sendinghost;        /* sending hostname */
  8125.       long msize;            /* approximate maximum message size */
  8126. +     char *peerhostname;        /* name of SMTP peer or "localhost" */
  8127.       auto char *delimptr;
  8128.       char *id;
  8129.       int nrcpts;            /* number of RCPT commands */
  8130.       bool doublequeue;
  8131. +     int badcommands = 0;        /* count of bad commands */
  8132.       char inp[MAXLINE];
  8133.       char cmdbuf[MAXLINE];
  8134.       extern char Version[];
  8135. ***************
  8136. *** 147,156 ****
  8137.           (void) dup2(fileno(OutChannel), fileno(stdout));
  8138.       }
  8139.       settime(e);
  8140. !     CurHostName = RealHostName;
  8141.       CurSmtpClient = macvalue('_', e);
  8142.       if (CurSmtpClient == NULL)
  8143. !         CurSmtpClient = RealHostName;
  8144.   
  8145.       setproctitle("server %s startup", CurSmtpClient);
  8146.       expand("\201e", inp, &inp[sizeof inp], e);
  8147. --- 153,165 ----
  8148.           (void) dup2(fileno(OutChannel), fileno(stdout));
  8149.       }
  8150.       settime(e);
  8151. !     peerhostname = RealHostName;
  8152. !     if (peerhostname == NULL)
  8153. !         peerhostname = "localhost";
  8154. !     CurHostName = peerhostname;
  8155.       CurSmtpClient = macvalue('_', e);
  8156.       if (CurSmtpClient == NULL)
  8157. !         CurSmtpClient = CurHostName;
  8158.   
  8159.       setproctitle("server %s startup", CurSmtpClient);
  8160.       expand("\201e", inp, &inp[sizeof inp], e);
  8161. ***************
  8162. *** 170,180 ****
  8163.       for (;;)
  8164.       {
  8165.           /* arrange for backout */
  8166. !         if (setjmp(TopFrame) > 0 && InChild)
  8167.           {
  8168. !             QuickAbort = FALSE;
  8169. !             SuprErrs = TRUE;
  8170. !             finis();
  8171.           }
  8172.           QuickAbort = FALSE;
  8173.           HoldErrs = FALSE;
  8174. --- 179,193 ----
  8175.       for (;;)
  8176.       {
  8177.           /* arrange for backout */
  8178. !         if (setjmp(TopFrame) > 0)
  8179.           {
  8180. !             /* if() nesting is necessary for Cray UNICOS */
  8181. !             if (InChild)
  8182. !             {
  8183. !                 QuickAbort = FALSE;
  8184. !                 SuprErrs = TRUE;
  8185. !                 finis();
  8186. !             }
  8187.           }
  8188.           QuickAbort = FALSE;
  8189.           HoldErrs = FALSE;
  8190. ***************
  8191. *** 196,201 ****
  8192. --- 209,215 ----
  8193.           if (p == NULL)
  8194.           {
  8195.               /* end of file, just die */
  8196. +             disconnect(1, e);
  8197.               message("421 %s Lost input channel from %s",
  8198.                   MyHostName, CurSmtpClient);
  8199.   #ifdef LOG
  8200. ***************
  8201. *** 260,273 ****
  8202.                   SmtpPhase = "server HELO";
  8203.               }
  8204.               sendinghost = newstr(p);
  8205. -             if (strcasecmp(p, RealHostName) != 0 &&
  8206. -                 (strcasecmp(RealHostName, "localhost") != 0 ||
  8207. -                  strcasecmp(p, MyHostName) != 0))
  8208. -             {
  8209. -                 auth_warning(e, "Host %s claimed to be %s",
  8210. -                     RealHostName, p);
  8211. -             }
  8212.               gothello = TRUE;
  8213.               if (c->cmdcode != CMDEHLO)
  8214.               {
  8215. --- 274,279 ----
  8216. ***************
  8217. *** 297,303 ****
  8218.               {
  8219.                   /* set sending host to our known value */
  8220.                   if (sendinghost == NULL)
  8221. !                     sendinghost = RealHostName;
  8222.   
  8223.                   if (bitset(PRIV_NEEDMAILHELO, PrivacyFlags))
  8224.                   {
  8225. --- 303,309 ----
  8226.               {
  8227.                   /* set sending host to our known value */
  8228.                   if (sendinghost == NULL)
  8229. !                     sendinghost = peerhostname;
  8230.   
  8231.                   if (bitset(PRIV_NEEDMAILHELO, PrivacyFlags))
  8232.                   {
  8233. ***************
  8234. *** 326,333 ****
  8235.               {
  8236.                   auth_warning(e,
  8237.                       "Host %s didn't use HELO protocol",
  8238. !                     RealHostName);
  8239.               }
  8240.               if (protocol == NULL)
  8241.                   protocol = "SMTP";
  8242.               define('r', protocol, e);
  8243. --- 332,349 ----
  8244.               {
  8245.                   auth_warning(e,
  8246.                       "Host %s didn't use HELO protocol",
  8247. !                     peerhostname);
  8248.               }
  8249. + #ifdef PICKY_HELO_CHECK
  8250. +             if (strcasecmp(sendinghost, peerhostname) != 0 &&
  8251. +                 (strcasecmp(peerhostname, "localhost") != 0 ||
  8252. +                  strcasecmp(sendinghost, MyHostName) != 0))
  8253. +             {
  8254. +                 auth_warning(e, "Host %s claimed to be %s",
  8255. +                     peerhostname, sendinghost);
  8256. +             }
  8257. + #endif
  8258.               if (protocol == NULL)
  8259.                   protocol = "SMTP";
  8260.               define('r', protocol, e);
  8261. ***************
  8262. *** 362,373 ****
  8263.               if (p != NULL && *p != '\0')
  8264.                   *p++ = '\0';
  8265.   
  8266.               /* now parse ESMTP arguments */
  8267.               msize = 0;
  8268.               for (; p != NULL && *p != '\0'; p++)
  8269.               {
  8270.                   char *kp;
  8271. !                 char *vp;
  8272.   
  8273.                   /* locate the beginning of the keyword */
  8274.                   while (isascii(*p) && isspace(*p))
  8275. --- 378,398 ----
  8276.               if (p != NULL && *p != '\0')
  8277.                   *p++ = '\0';
  8278.   
  8279. +             /* check for possible spoofing */
  8280. +             if (RealUid != 0 && OpMode == MD_SMTP &&
  8281. +                 (e->e_from.q_mailer != LocalMailer &&
  8282. +                  strcmp(e->e_from.q_user, RealUserName) != 0))
  8283. +             {
  8284. +                 auth_warning(e, "%s owned process doing -bs",
  8285. +                     RealUserName);
  8286. +             }
  8287.               /* now parse ESMTP arguments */
  8288.               msize = 0;
  8289.               for (; p != NULL && *p != '\0'; p++)
  8290.               {
  8291.                   char *kp;
  8292. !                 char *vp = NULL;
  8293.   
  8294.                   /* locate the beginning of the keyword */
  8295.                   while (isascii(*p) && isspace(*p))
  8296. ***************
  8297. *** 700,707 ****
  8298.             case CMDQUIT:        /* quit -- leave mail */
  8299.               message("221 %s closing connection", MyHostName);
  8300.   
  8301.               /* avoid future 050 messages */
  8302. !             Verbose = FALSE;
  8303.   
  8304.               if (InChild)
  8305.                   ExitStat = EX_QUIT;
  8306. --- 725,733 ----
  8307.             case CMDQUIT:        /* quit -- leave mail */
  8308.               message("221 %s closing connection", MyHostName);
  8309.   
  8310. + doquit:
  8311.               /* avoid future 050 messages */
  8312. !             disconnect(1, e);
  8313.   
  8314.               if (InChild)
  8315.                   ExitStat = EX_QUIT;
  8316. ***************
  8317. *** 745,756 ****
  8318.               if (LogLevel > 0)
  8319.                   syslog(LOG_CRIT,
  8320.                       "\"%s\" command from %s (%s)",
  8321. !                     c->cmdname, RealHostName,
  8322.                       anynet_ntoa(&RealHostAddr));
  8323.   # endif
  8324.               /* FALL THROUGH */
  8325.   
  8326.             case CMDERROR:    /* unknown command */
  8327.               message("500 Command unrecognized");
  8328.               break;
  8329.   
  8330. --- 771,789 ----
  8331.               if (LogLevel > 0)
  8332.                   syslog(LOG_CRIT,
  8333.                       "\"%s\" command from %s (%s)",
  8334. !                     c->cmdname, peerhostname,
  8335.                       anynet_ntoa(&RealHostAddr));
  8336.   # endif
  8337.               /* FALL THROUGH */
  8338.   
  8339.             case CMDERROR:    /* unknown command */
  8340. +             if (++badcommands > MAXBADCOMMANDS)
  8341. +             {
  8342. +                 message("421 %s Too many bad commands; closing connection",
  8343. +                     MyHostName);
  8344. +                 goto doquit;
  8345. +             }
  8346.               message("500 Command unrecognized");
  8347.               break;
  8348.   
  8349. ***************
  8350. *** 782,787 ****
  8351. --- 815,821 ----
  8352.       char *w;
  8353.   {
  8354.       register char *q;
  8355. +     char *firstp = p;
  8356.   
  8357.       /* find beginning of word */
  8358.       while (isascii(*p) && isspace(*p))
  8359. ***************
  8360. *** 796,802 ****
  8361.       if (*p != ':')
  8362.       {
  8363.         syntax:
  8364. !         message("501 Syntax error in parameters");
  8365.           Errors++;
  8366.           return (NULL);
  8367.       }
  8368. --- 830,837 ----
  8369.       if (*p != ':')
  8370.       {
  8371.         syntax:
  8372. !         message("501 Syntax error in parameters scanning \"%s\"",
  8373. !             firstp);
  8374.           Errors++;
  8375.           return (NULL);
  8376.       }
  8377. ***************
  8378. *** 955,962 ****
  8379.                       label, st & 0177);
  8380.   
  8381.               /* if we exited on a QUIT command, complete the process */
  8382. !             if (st == (EX_QUIT << 8))
  8383.                   finis();
  8384.   
  8385.               return (1);
  8386.           }
  8387. --- 990,1000 ----
  8388.                       label, st & 0177);
  8389.   
  8390.               /* if we exited on a QUIT command, complete the process */
  8391. !             if (WEXITSTATUS(st) == EX_QUIT)
  8392. !             {
  8393. !                 disconnect(1, e);
  8394.                   finis();
  8395. +             }
  8396.   
  8397.               return (1);
  8398.           }
  8399. *** src/udb.c.OLD    Thu Nov 25 11:23:27 1993
  8400. --- src/udb.c    Fri Mar 11 14:42:17 1994
  8401. ***************
  8402. *** 36,50 ****
  8403.   
  8404.   #ifndef lint
  8405.   #ifdef USERDB
  8406. ! static char sccsid [] = "@(#)udb.c    8.4 (Berkeley) 11/25/93 (with USERDB)";
  8407.   #else
  8408. ! static char sccsid [] = "@(#)udb.c    8.4 (Berkeley) 11/25/93 (without USERDB)";
  8409.   #endif
  8410.   #endif
  8411.   
  8412.   #ifdef USERDB
  8413.   
  8414. - #include <sys/time.h>
  8415.   #include <errno.h>
  8416.   #include <netdb.h>
  8417.   #include <db.h>
  8418. --- 36,49 ----
  8419.   
  8420.   #ifndef lint
  8421.   #ifdef USERDB
  8422. ! static char sccsid [] = "@(#)udb.c    8.6 (Berkeley) 3/11/94 (with USERDB)";
  8423.   #else
  8424. ! static char sccsid [] = "@(#)udb.c    8.6 (Berkeley) 3/11/94 (without USERDB)";
  8425.   #endif
  8426.   #endif
  8427.   
  8428.   #ifdef USERDB
  8429.   
  8430.   #include <errno.h>
  8431.   #include <netdb.h>
  8432.   #include <db.h>
  8433. ***************
  8434. *** 571,577 ****
  8435.             case '*':    /* search remote database (expand MX) */
  8436.               if (*spec == '*')
  8437.               {
  8438. ! #ifdef NAMED_BIND
  8439.                   nmx = getmxrr(spec + 1, mxhosts, FALSE, &rcode);
  8440.   #else
  8441.                   mxhosts[0] = spec + 1;
  8442. --- 570,576 ----
  8443.             case '*':    /* search remote database (expand MX) */
  8444.               if (*spec == '*')
  8445.               {
  8446. ! #if NAMED_BIND
  8447.                   nmx = getmxrr(spec + 1, mxhosts, FALSE, &rcode);
  8448.   #else
  8449.                   mxhosts[0] = spec + 1;
  8450. *** src/usersmtp.c.OLD    Wed Jan  5 09:20:15 1994
  8451. --- src/usersmtp.c    Thu Mar 10 18:03:26 1994
  8452. ***************
  8453. *** 36,44 ****
  8454.   
  8455.   #ifndef lint
  8456.   #ifdef SMTP
  8457. ! static char sccsid[] = "@(#)usersmtp.c    8.17 (Berkeley) 1/5/94 (with SMTP)";
  8458.   #else
  8459. ! static char sccsid[] = "@(#)usersmtp.c    8.17 (Berkeley) 1/5/94 (without SMTP)";
  8460.   #endif
  8461.   #endif /* not lint */
  8462.   
  8463. --- 36,44 ----
  8464.   
  8465.   #ifndef lint
  8466.   #ifdef SMTP
  8467. ! static char sccsid[] = "@(#)usersmtp.c    8.18 (Berkeley) 1/24/94 (with SMTP)";
  8468.   #else
  8469. ! static char sccsid[] = "@(#)usersmtp.c    8.18 (Berkeley) 1/24/94 (without SMTP)";
  8470.   #endif
  8471.   #endif /* not lint */
  8472.   
  8473. ***************
  8474. *** 303,309 ****
  8475. --- 303,312 ----
  8476.               mci->mci_maxsize = atol(p);
  8477.       }
  8478.       else if (strcasecmp(line, "8bitmime") == 0)
  8479. +     {
  8480.           mci->mci_flags |= MCIF_8BITMIME;
  8481. +         mci->mci_flags &= ~MCIF_7BIT;
  8482. +     }
  8483.       else if (strcasecmp(line, "expn") == 0)
  8484.           mci->mci_flags |= MCIF_EXPN;
  8485.   }
  8486. ***************
  8487. *** 536,544 ****
  8488.       ev = setevent(timeout, datatimeout, 0);
  8489.   
  8490.       /* now output the actual message */
  8491. !     (*e->e_puthdr)(mci->mci_out, m, e);
  8492. !     putline("\n", mci->mci_out, m);
  8493. !     (*e->e_putbody)(mci->mci_out, m, e, NULL);
  8494.   
  8495.       clrevent(ev);
  8496.   
  8497. --- 539,547 ----
  8498.       ev = setevent(timeout, datatimeout, 0);
  8499.   
  8500.       /* now output the actual message */
  8501. !     (*e->e_puthdr)(mci, e);
  8502. !     putline("\n", mci);
  8503. !     (*e->e_putbody)(mci, e, NULL);
  8504.   
  8505.       clrevent(ev);
  8506.   
  8507. *** src/util.c.OLD    Tue Jan  4 06:40:38 1994
  8508. --- src/util.c    Fri Mar 11 11:09:17 1994
  8509. ***************
  8510. *** 33,39 ****
  8511.    */
  8512.   
  8513.   #ifndef lint
  8514. ! static char sccsid[] = "@(#)util.c    8.28 (Berkeley) 1/4/94";
  8515.   #endif /* not lint */
  8516.   
  8517.   # include "sendmail.h"
  8518. --- 33,39 ----
  8519.    */
  8520.   
  8521.   #ifndef lint
  8522. ! static char sccsid[] = "@(#)util.c    8.34 (Berkeley) 3/11/94";
  8523.   #endif /* not lint */
  8524.   
  8525.   # include "sendmail.h"
  8526. ***************
  8527. *** 644,651 ****
  8528.           fd = open(filename, omode, cmode);
  8529.           if (fd >= 0)
  8530.               break;
  8531. !         if (errno != ENFILE && errno != EINTR)
  8532. !             break;
  8533.       }
  8534.       if (fd >= 0 && fstat(fd, &st) >= 0 && S_ISREG(st.st_mode))
  8535.       {
  8536. --- 644,659 ----
  8537.           fd = open(filename, omode, cmode);
  8538.           if (fd >= 0)
  8539.               break;
  8540. !         switch (errno)
  8541. !         {
  8542. !           case ENFILE:        /* system file table full */
  8543. !           case EINTR:        /* interrupted syscall */
  8544. ! #ifdef ETXTBSY
  8545. !           case ETXTBSY:        /* Apollo: net file locked */
  8546. ! #endif
  8547. !             continue;
  8548. !         }
  8549. !         break;
  8550.       }
  8551.       if (fd >= 0 && fstat(fd, &st) >= 0 && S_ISREG(st.st_mode))
  8552.       {
  8553. ***************
  8554. *** 672,679 ****
  8555.   **
  8556.   **    Parameters:
  8557.   **        l -- line to put.
  8558. ! **        fp -- file to put it onto.
  8559. ! **        m -- the mailer used to control output.
  8560.   **
  8561.   **    Returns:
  8562.   **        none
  8563. --- 680,686 ----
  8564.   **
  8565.   **    Parameters:
  8566.   **        l -- line to put.
  8567. ! **        mci -- the mailer connection information.
  8568.   **
  8569.   **    Returns:
  8570.   **        none
  8571. ***************
  8572. *** 682,697 ****
  8573.   **        output of l to fp.
  8574.   */
  8575.   
  8576. ! putline(l, fp, m)
  8577.       register char *l;
  8578. !     FILE *fp;
  8579. !     MAILER *m;
  8580.   {
  8581.       register char *p;
  8582.       register char svchar;
  8583.   
  8584.       /* strip out 0200 bits -- these can look like TELNET protocol */
  8585. !     if (bitnset(M_7BITS, m->m_flags))
  8586.       {
  8587.           for (p = l; (svchar = *p) != '\0'; ++p)
  8588.               if (bitset(0200, svchar))
  8589. --- 689,704 ----
  8590.   **        output of l to fp.
  8591.   */
  8592.   
  8593. ! putline(l, mci)
  8594.       register char *l;
  8595. !     register MCI *mci;
  8596.   {
  8597.       register char *p;
  8598.       register char svchar;
  8599. +     int slop = 0;
  8600.   
  8601.       /* strip out 0200 bits -- these can look like TELNET protocol */
  8602. !     if (bitset(MCIF_7BIT, mci->mci_flags))
  8603.       {
  8604.           for (p = l; (svchar = *p) != '\0'; ++p)
  8605.               if (bitset(0200, svchar))
  8606. ***************
  8607. *** 709,740 ****
  8608.               fprintf(TrafficLogFile, "%05d >>> ", getpid());
  8609.   
  8610.           /* check for line overflow */
  8611. !         while (m->m_linelimit > 0 && (p - l) > m->m_linelimit)
  8612.           {
  8613. !             register char *q = &l[m->m_linelimit - 1];
  8614.   
  8615.               svchar = *q;
  8616.               *q = '\0';
  8617. !             if (l[0] == '.' && bitnset(M_XDOT, m->m_flags))
  8618.               {
  8619. !                 (void) putc('.', fp);
  8620.                   if (TrafficLogFile != NULL)
  8621.                       (void) putc('.', TrafficLogFile);
  8622.               }
  8623. !             fputs(l, fp);
  8624. !             (void) putc('!', fp);
  8625. !             fputs(m->m_eol, fp);
  8626.               if (TrafficLogFile != NULL)
  8627. !                 fprintf(TrafficLogFile, "%s!\n%05d >>> ",
  8628.                       l, getpid());
  8629.               *q = svchar;
  8630.               l = q;
  8631.           }
  8632.   
  8633.           /* output last part */
  8634. !         if (l[0] == '.' && bitnset(M_XDOT, m->m_flags))
  8635.           {
  8636. !             (void) putc('.', fp);
  8637.               if (TrafficLogFile != NULL)
  8638.                   (void) putc('.', TrafficLogFile);
  8639.           }
  8640. --- 716,752 ----
  8641.               fprintf(TrafficLogFile, "%05d >>> ", getpid());
  8642.   
  8643.           /* check for line overflow */
  8644. !         while (mci->mci_mailer->m_linelimit > 0 &&
  8645. !                (p - l + slop) > mci->mci_mailer->m_linelimit)
  8646.           {
  8647. !             register char *q = &l[mci->mci_mailer->m_linelimit - slop - 1];
  8648.   
  8649.               svchar = *q;
  8650.               *q = '\0';
  8651. !             if (l[0] == '.' && slop == 0 &&
  8652. !                 bitnset(M_XDOT, mci->mci_mailer->m_flags))
  8653.               {
  8654. !                 (void) putc('.', mci->mci_out);
  8655.                   if (TrafficLogFile != NULL)
  8656.                       (void) putc('.', TrafficLogFile);
  8657.               }
  8658. !             fputs(l, mci->mci_out);
  8659. !             (void) putc('!', mci->mci_out);
  8660. !             fputs(mci->mci_mailer->m_eol, mci->mci_out);
  8661. !             (void) putc(' ', mci->mci_out);
  8662.               if (TrafficLogFile != NULL)
  8663. !                 fprintf(TrafficLogFile, "%s!\n%05d >>>  ",
  8664.                       l, getpid());
  8665.               *q = svchar;
  8666.               l = q;
  8667. +             slop = 1;
  8668.           }
  8669.   
  8670.           /* output last part */
  8671. !         if (l[0] == '.' && slop == 0 &&
  8672. !             bitnset(M_XDOT, mci->mci_mailer->m_flags))
  8673.           {
  8674. !             (void) putc('.', mci->mci_out);
  8675.               if (TrafficLogFile != NULL)
  8676.                   (void) putc('.', TrafficLogFile);
  8677.           }
  8678. ***************
  8679. *** 741,748 ****
  8680.           if (TrafficLogFile != NULL)
  8681.               fprintf(TrafficLogFile, "%.*s\n", p - l, l);
  8682.           for ( ; l < p; ++l)
  8683. !             (void) putc(*l, fp);
  8684. !         fputs(m->m_eol, fp);
  8685.           if (*l == '\n')
  8686.               ++l;
  8687.       } while (l[0] != '\0');
  8688. --- 753,760 ----
  8689.           if (TrafficLogFile != NULL)
  8690.               fprintf(TrafficLogFile, "%.*s\n", p - l, l);
  8691.           for ( ; l < p; ++l)
  8692. !             (void) putc(*l, mci->mci_out);
  8693. !         fputs(mci->mci_mailer->m_eol, mci->mci_out);
  8694.           if (*l == '\n')
  8695.               ++l;
  8696.       } while (l[0] != '\0');
  8697. ***************
  8698. *** 836,841 ****
  8699. --- 848,859 ----
  8700.       register EVENT *ev = NULL;
  8701.       register char *p;
  8702.   
  8703. +     if (fp == NULL)
  8704. +     {
  8705. +         buf[0] = '\0';
  8706. +         return NULL;
  8707. +     }
  8708.       /* set the timeout */
  8709.       if (timeout != 0)
  8710.       {
  8711. ***************
  8712. *** 1309,1315 ****
  8713.           p += strlen(p);
  8714.           goto defprint;
  8715.   
  8716. ! #ifdef S_IFIFO
  8717.         case S_IFIFO:
  8718.           sprintf(p, "FIFO: ");
  8719.           p += strlen(p);
  8720. --- 1327,1333 ----
  8721.           p += strlen(p);
  8722.           goto defprint;
  8723.   
  8724. ! #if defined(S_IFIFO) && (!defined(S_IFSOCK) || S_IFIFO != S_IFSOCK)
  8725.         case S_IFIFO:
  8726.           sprintf(p, "FIFO: ");
  8727.           p += strlen(p);
  8728. *** src/version.c.OLD    Sat Jan 15 18:44:33 1994
  8729. --- src/version.c    Sun Mar 13 09:39:08 1994
  8730. ***************
  8731. *** 33,39 ****
  8732.    */
  8733.   
  8734.   #ifndef lint
  8735. ! static char sccsid[] = "@(#)version.c    8.6.1.5 (Berkeley) 1/13/94";
  8736.   #endif /* not lint */
  8737.   
  8738. ! char    Version[] = "8.6.5";
  8739. --- 33,39 ----
  8740.    */
  8741.   
  8742.   #ifndef lint
  8743. ! static char sccsid[] = "@(#)version.c    8.6.6.1 (Berkeley) 3/13/94";
  8744.   #endif /* not lint */
  8745.   
  8746. ! char    Version[] = "8.6.6";
  8747.